I got the following error when I try to run the console. It used to
be able to run without problems.
script/console
Loading development environment.
/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require': no such
file to load -- readline (LoadError)
from /usr/local/lib/ruby/1.8/irb/completion.rb:10
from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `require'
from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `each'
from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `load_modules'
from /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup'
from /usr/local/lib/ruby/1.8/irb.rb:54:in `start'
from /usr/local/bin/irb:13
I found that my ruby was not built with readline support because I
downloaded and installed the latest version 1.8.6, not the Ubuntu
package. What I did to fix it was to rebuild ruby with readline
support:
./configure --with-readline-dir=/usr/local
make
make install
Now script/console works as expected. However, before I included the
readline support, irb works but not script/console. Why?