How to Get Readline Support in Irb Using Rvm on Ubuntu 11.10

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

Ok, so this might seem pretty obvious, well it always is when you know the answer:

I gave up using RVM, and switched to rbenv - which I'm very pleased I did!

sudo apt-get install libreadline-gplv2-dev
CONFIGURE_OPTS="--with-readline-dir=/usr/include/readline --with-openssl-dir=/usr/local" rbenv-install 1.9.2-p290

This installed without error - and I'm still not convinced I need the gplv2 package as I've got libreadline6-dev installed. However that STILL didn't resolve my problem. It did remove RVM from the equation, and show me that despite my best efforts the IRB shell was refusing to use readline.

The answer came from reading through this great guide:

RubyTools.pdf

Inside my ~/.irbrc file I found:

IRB.conf[:USE_READLINE] = false

A quick update to:

IRB.conf[:USE_READLINE] = true

And I'm cooking on gas!!

Thanks for all the great answers and suggestion, I do appreciate your time.

Readline not working in rvm - Ubuntu 11.10

I got the solution:

Run the command

rvm requirements

It shows the requirements and dependencies. Install those and reinstall the ruby on rvm

rvm remove 1.9.2
rvm install 1.9.2

It works!

Problems with the rails console, RVM and readline

I had a similar problem it was with 1.9.2 on Ubuntu 10.04, but the symptoms were identical. In order to get it to work:

rvm pkg install readline

or prior to RVM version 1.6.32, you need the following command

rvm package install readline

Then:

apt-get install ncurses-dev

And then taking from their instructions at http://rvm.beginrescueend.com/packages/readline/

cd $HOME/.rvm/src/ruby-1.9.2-p0/ext/readline
ruby extconf.rb -- --with-readline-dir="$HOME/.rvm/usr"
make install

I had actually done a system rvm install on the server, so I needed to do this:

cd $HOME/.rvm/src/ruby-1.9.2-p0/ext/readline
ruby extconf.rb -- --with-readline-dir="/usr/local/rvm/usr"
make install

After that I was able to have full access to the console.

How to reinstall ruby with readline support?

Your ruby should be most likely installed with readline support if you had the packages from rvm requirements installed.

You can verify that readline is installed by running:

rvm use 1.9.3
find $MY_RUBY_HOME -name readline.so | xargs ldd

From what I see in the responses a proper flow has to be repeated:

rm -rf $rvm_path/usr/
rvm get head
rvm remove 1.9.3
rvm install 1.9.3 --debug

If you still can not get it working - please make double sure you repeat the above steps, do not add additional flags or switches, make sure to clean up /etc/rvmrc and ~/.rvmrc from extra compilation flags. if it all fails provide output of the rvm install 1.9.3 --debug command.

some readline lib missing for ruby on ubuntu 12.04 with rvm

Try to download libreadline5-dev package for your architecture, for example, from here and install install it manually.

sudo dpkg -i downloaded_package.deb

It should help you.



Related Topics



Leave a reply



Submit