Wednesday, May 30, 2007

rails script/console problem on ubuntu

shell> ruby 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 `load_modules'

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

Check them out:
http://ubuntuforums.org/showthread.php?t=169891
http://blog.nanorails.com/articles/2006/03/06/installing-readline-on-kubuntu

1.) Download ruby source.
Download Here
2.) Extract the tar file.
tar -xvf ruby-1.8.5-p12.tar.gz
3.) Change to that directory
cd ruby-1.8.5-p12.tar.gz
4.) Type these commands.
./configure
make
sudo make install
5.) Install readline and ncurses.
apt-get install libncurses5-dev libreadline5-dev
6.) go back to the folder ruby source folder.
ruby-1.8.5-p12.tar.gz
7.) Type these commands
cd ext
cd readline
ruby extconf.rb
make
sudo make install

Thats it. The console bug no longer appears.

No comments :