Rails3 console crashes at startup

I’m working on a new Rails3’s project. I’m new to Rails3 and Ruby 1.9.2 so I’ve never seen it before. After starting the server with ‘rails s’, I tried to start the console but I got this error:

.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb/completion.rb:9:in `require': no such file to load -- readline (LoadError)
.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/irb/completion.rb:9:in `<top (required)>'
.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0/lib/rails/commands/console.rb:3:in `require'
.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0/lib/rails/commands/console.rb:3:in `<top (required)>'
.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0/lib/rails/commands.rb:20:in `require'
.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.0/lib/rails/commands.rb:20:in `<top (required)>'
script/rails:6:in `require'
from script/rails:6:in `<main>'

After surfing the net, I’ve found an easy solution. Since I’m using RVM I’ve only needed to follow these steps:

  1. rvm pkg install readline
  2. rvm remove 1.9.2-p0
  3. rvm install 1.9.2-p0 -C –with-readline-dir=$HOME/.rvm/usr

Now everything work right…