Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

make

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?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.