readline.so: libreadline.so.5: cannot open shared object file

root@vps:/var/www/# rails c

/usr/local/lib/ruby/1.8/x86_64-linux/readline.so: libreadline.so.5: cannot open shared object file: No such file or directory - /usr/local/lib/ruby/1.8/x86_64-linux/readline.so (LoadError)

    from /usr/local/lib/ruby/1.8/irb/completion.rb:10

    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.0.1/lib/rails/commands/console.rb:3:in `require’

    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.0.1/lib/rails/commands/console.rb:3

    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.0.1/lib/rails/commands.rb:20:in `require’

    from /usr/local/lib/ruby/gems/1.8/gems/railties-3.0.1/lib/rails/commands.rb:20

    from script/rails:6:in `require’

    from script/rails:6

安装 libreadline-ruby1.8 即可解决此问题

root@vps:/var/www/# apt-get install libreadline-ruby1.8