When trying to install ruby 1.9.2 on Ubuntu 10.04 (64-bit), I get the following error after performing the following steps:

  1. Install Dependencies
  2. ./configure to create make file
  3. Make
  4. Make Install
  5. Make Clean
  6. ruby -ropenssl -rzlib -rreadline -e "puts :Hello" (This should output 'hello' if all is well).,

Instead of outputting hello, I get this:

require: no such file to load -- readline`

After searching online, I find this solution: Blockquote

If you’ve compiled Ruby from source, you might get this error when executing script/console:

/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require': no such file to load -- readline (LoadError) One way of fixing this is to compile readline, which is distributed along with the Ruby source:

cd /opt/src/ruby-1.8.5-p2/ext/readline

ruby extconf.rb


sudo make install

This totally worked for me. My question is, why didn't ruby compile this to begin with? Did I forget some sort of config option?

2 Answers 2


The reason Ruby didn't automatically include readline support was most likely because you didn't have libreadline, and its development files, installed on your system. When you run ./configure it does an inventory of your system, and uses that data to create an "optimal" Makefile.

The easiest way to get libreadline, and its development files, is to install the package libreadline-dev.


Many (in fact, most) libraries and programming languages don't compile readline by default (PHP is another example). You need to configure that manually in the configure script or using this method. Just make sure you use the same option whenever you compile Ruby.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .