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 ruby ruby

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


Ubuntu 12.04 here: the answers here helped, but were also misleading.

If you're using Ubuntu 12.04, DO NOT pkg install readline, with or without --skip-autoreconf. After you've done that, either readline or zlib will be broken no matter what combination of switches you give to rvm install 1.9.3.

To get it to work, do the apt-get install that rvm requirements tells you to do, do a pkg uninstall readline and then do a simple rvm remove 1.9.3; rvm install 1.9.3


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.


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-devCONFIGURE_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.