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:inrequire’
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:ineach’
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:insetup’
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?
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?
Ray,
apt-get install libncurses5-dev libreadline5-dev
cd /ruby-1.8.6/ext/readline
ruby extconf.rb
make
sudo make install
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.