Saturday, August 20, 2011

error: no such file to load — readline 

The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are typed in. (…) The Readline library includes additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those lines, and perform csh-like history expansion on previous command.

For more info about read line visit http://bogojoker.com/readline/

When I started  rails console: I got an error saying:
no such file to load — readline (LoadError).  At that time i was on Ubuntu 10.04 system with rvm, rails3, ruby 1.9.2-p290.
I tracked down redline in my ruby source ~/.rvm/src/ruby-1.9.2-p290/ext/readline and ran:
ruby extconf.rb
(Note: here ruby-1.9.2-p290 is the default ruby in rvm. Replace with your ruby version if you have to.)
This let me know I was missing these two packages:
libncurses5-dev and libreadline5-dev
Install these packages with this command

sudo apt-get install libncurses5-dev libreadline5-dev
Then run the command from before:
ruby extconf.rb
Note :
You should be in the  ~/.rvm/src/ruby-1.9.2-p290/ext/readline
directory while entering this command.
I think you should get all passing.
make
make install
Hurray now rails c works.

No comments:

Post a Comment