in Linux, Quid Pro Quo, Rails

Installing readline on Kubuntu

Running script/console provides the delightful answer:

/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require’:
no such file to load – readline (LoadError)

Turns out that Kubuntu doesn’t have the curses libraries.

Here’s the begining of a solution

apt-get install libncurses5-dev libreadline5-dev (Ubuntu/Debian)

Then recompile the readline extension and go from there.

cd ext/readline
ruby extconf.rb
make
sudo make install

Read more

  1. Niether does ubuntu (well that was pretty obvious if kububtu didnt have them) but thanks for this, i was so confused..

  2. thanks for your blog on this. im using ubuntu. i followed your instructions. now my irb has tab completion! thanks a rubillion! :)

  3. Thank you for the kind words. I’m thrilled you found this useful!

  4. exactly how does one go about “recompiling the readline extension”?

  5. Pete,
    assuming you’ve compiled ruby from source, or you have the source available, you would go in the ext/readline directory of your ruby source. From there, typying

    ruby extconf.rb
    make clean
    sudo make install

    should do it.
    If you have not installed ruby from source, you might be able to get away from getting the source and compiling readline by itself. In my case, the available version of ruby via apt-get was older, so I went for ruby 1.8.4 but readline didn’t build when I first went through the install because of the missing dependencies.

  6. thank you very much. it fixed my problem on my ubuntu.
    Merci beaucoup :)

  7. Thank you! I built ruby 1.8.6 from the source and had this problem.

Comments are closed.