compiling readline into an existing Ruby installation

Yesterday I ran into a problem on a existing Ruby installation on a Centos server. When I tried to access script/console, I got the following error:

require’: no such file to load — readline (LoadError)

Doh! Turns out, the solution is to simply compile readline again.

So you need to download Ruby again:

wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz

extract it:

tar xvfz ruby-1.8.7-p72.tar.gz

and we’ll compile it:

cd ruby-1.8.7-p72/ext/readline/

ruby extconf.rb
sudo make
sudo make install

If you face any error related to readline-devel while compiling readline, it can be solved by installing readline-devel:

sudo yum install readline-devel

And that’s it. Readline working again and script/console too.

2 thoughts on “compiling readline into an existing Ruby installation

Comments are closed.