How to get Readline support in IRB using RVM on Ubuntu 11.10

前端 未结 12 1708
北恋
北恋 2020-12-07 14:51

I have tried everything I can think of to get this to work, to no avail so here I am requesting suggestions on how to debug.

Firstly, runnning Ubuntu 11.10

I

相关标签:
12条回答
  • 2020-12-07 15:19

    For me, it just worked out of the box with the latest verison of rvm. My steps

    bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
    

    according to rvm requirements:

    apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
    
    rvm install 1.9.3
    
    rvm
    
    0 讨论(0)
  • 2020-12-07 15:23

    I struggled with this same issue with Ubuntu 11.10.

    In my case readline would seemingly compile properly if I used the following:

    $ rvm --skip-autoreconf pkg install readline
    

    as outlined at the bottom of http://beginrescueend.com/packages/readline/

    However, when I invoked irb, I would get the normal error "Unable to require readline"

    Finally, based on Shane's command line, I invoked the following:

    $ rvm install 1.9.3 --with-readline-dir=$rvm_usr_path --with-iconv-dir=$rvm_usr_path --with-zlib-dir=$rvm_usr_path --with-openssl-dir=$rvm_usr_path
    

    rather than the command mentioned at http://beginrescueend.com/packages/readline/

    $ rvm install 1.9.2 --with-readline-dir=$rvm_path/usr
    

    In my case version 1.9.3 was what I wanted. And finally irb came up with a functioning readline.

    Thanks to everyone here for pointing me in the right direction.

    0 讨论(0)
  • 2020-12-07 15:25

    I had the same issue but I'm on 11.04 and from reading the link you gave https://github.com/wayneeseguin/rvm/issues/553 and from the info in peplins comment there I removed the autoreconf call that was added here
    https://github.com/wayneeseguin/rvm/commit/94c301d and now readline compiles without any errors. I added back in the autoreconf call after I had compiled readline before installing ruby again.

    So this is how I got it work:

    edit ~/.rvm/scripts/functions/pkg and delete the following:

    if [[ "${rvm_skip_autoreconf_flag:-0}" == 0 ]] &&
      which autoreconf >/dev/null 2>&1 &&
      which libtoolize >/dev/null 2>&1 &&
      [[ -f configure.ac || -f configure.in ]]
    then
    __rvm_run "$package/autoreconf" \
      "autoreconf -is --force" \
      "Prepare $package in $rvm_src_path/$package-$version."
    fi
    

    Compile readline and remove ruby (I used the ree_dependencies command but I'm not sure this is necessary):

    rvm pkg install ree_dependencies
    rvm remove 1.9.2
    

    undo your deletion to ~/.rvm/scripts/functions/pkg
    I then installed 1.9.2 with this command (again it's from the ree install which I'm not sure is necessary but this is what I used)

    rvm install 1.9.2 --with-readline-dir=$rvm_usr_path --with-iconv-dir=$rvm_usr_path --with-zlib-dir=$rvm_usr_path --with-openssl-dir=$rvm_usr_path
    

    and now all appears to work as it should, hope that helps someone.

    0 讨论(0)
  • 2020-12-07 15:26

    This solved my problem for rvm with Ruby 1.9.3

    gem install rb-readline
    
    0 讨论(0)
  • 2020-12-07 15:27

    Unfortunately none of these worked for me. I ended up using the Quick Fix from http://beginrescueend.com/packages/readline/

    That solved my problem.

    0 讨论(0)
  • 2020-12-07 15:30

    If you are using Bundler then the following might help:

    echo "gem 'rb-readline'" >> Gemfile
    bundle install
    
    0 讨论(0)
提交回复
热议问题