(These instructions are for Ubuntu for the error given below)
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

1. apt-get install libreadline-ruby
2. apt-get install libreadline-dev
3. cd to where your downloaded source for ruby is located. (say ~/installed-software/ruby-1.8.6.tar.gz)
4. cd to ruby-1.8.6
5. run ./configure
6. run make
7. run make install
While running make, while the lines are streaming by, you will be able to notice ‘compiling readline’.
8. try ruby script/console from your app dir. It should load it this time.