Script/console error

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

Ray,

Ray,

/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require’: no such
file to load – readline (LoadError)

Have you tried
http://www.oobaloo.co.uk/articles/2006/03/22/ruby-and-readline
http://ruphus.com/code/rails/railsonubuntu-howto.html

(found with Google)

Alain

blog.ravet.com

Thanks for the links.

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,

ray wrote:

Thanks for the links.

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