script/console on production server

I migrated my app using vlad-git and it runs. Now I logged in via ssh
and tried to run script/console on the production server.

The result is:
Loading development environment (Rails 2.3.5)
/opt/ruby-1.8.7-p249/lib/ruby/1.8/irb/completion.rb:10:in `require': no
such file to load -- readline (LoadError)
  from /opt/ruby-1.8.7-p249/lib/ruby/1.8/irb/completion.rb:10
  from /opt/ruby-1.8.7-p249/lib/ruby/1.8/irb/init.rb:254:in `require'
  from /opt/ruby-1.8.7-p249/lib/ruby/1.8/irb/init.rb:254:in
`load_modules'
  from /opt/ruby-1.8.7-p249/lib/ruby/1.8/irb/init.rb:252:in `each'
  from /opt/ruby-1.8.7-p249/lib/ruby/1.8/irb/init.rb:252:in
`load_modules'
  from /opt/ruby-1.8.7-p249/lib/ruby/1.8/irb/init.rb:21:in `setup'
  from /opt/ruby-1.8.7-p249/lib/ruby/1.8/irb.rb:54:in `start'
  from /usr/bin/irb:13

the very first 'require "readline"' in completion.rb fails.
script/console on my development machine works well.

Any idea, how to fix this?

Your ruby needs to be compiled with readline support. Make sure
libreadline is installed, then reconfigure and recompile.

damn , that happen to me to, it also happens if you install rvm with out specifiying the libraries like openssl and such, is you are using rvm you need to pass the --with option and add the extra support. anyway you have to recompile with the missing libraries

Fritz Trapper wrote:

the very first 'require "readline"' in completion.rb fails.
script/console on my development machine works well.

Any idea, how to fix this?

This happens often in linux (Ubuntu in particular) builds. Essentially
you need to install libreadline5-dev and then re-install.

libreadline
Strange irb behavior or

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

Navigate to the Ruby source and enter:
sudo apt-get install libreadline5-dev
cd ext/readline
ruby extconf.rb
make
sudo make install

Or, if you're using rvm see the following, from
http://rvm.beginrescueend.com/packages/readline/

∴ rvm package install readline
∴ rvm remove 1.9.2
∴ rvm install 1.9.2 -C --with-readline-dir=$HOME/.rvm/usr

Greg Donald wrote:

Your ruby needs to be compiled with readline support. Make sure
libreadline is installed, then reconfigure and recompile.

I compiled ruby-1.8.7-p249 myslf on ubuntu 8.04.

How to install libreadline? apt-get doesn't know about it.

Parker Selbert wrote:

sudo apt-get install libreadline5-dev

Ah, thanks, thats the answer.