Tuesday, December 19, 2006

If you get the following error when trying to run script/console in Ruby on Rails:


Loading development environment.
/usr/lib/ruby/1.8/irb/completion.rb:10:in `require': no such file to load -- readline (LoadError)
from /usr/lib/ruby/1.8/irb/completion.rb:10
from /usr/lib/ruby/1.8/irb/init.rb:252:in `require'
from /usr/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
from /usr/lib/ruby/1.8/irb/init.rb:250:in `each'
from /usr/lib/ruby/1.8/irb/init.rb:250:in `load_modules'
from /usr/lib/ruby/1.8/irb/init.rb:21:in `setup'
from /usr/lib/ruby/1.8/irb.rb:54:in `start'
from /usr/bin/irb:13


You need to install the readline-devel package and compile the readline extension:


cd /path/to/ruby_source/ext/readline
ruby extconf.rb
make
make install [do this as root/admin]