errors using ruby script/console

HI all, when i try to use the rails console with this command, ruby
script/console, i got the following errors:

/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

googled up and follow all instructions, still hitting this error. Any
ideas?

ok, solved. This is a little confusing according to some forums. I
will show u guys a step by step.

1. apt-get install libncurses5-dev libreadline5-dev

2. cd /ruby-1.8.6/ext/readline$

3. ruby extconf.rb

4. make

5. sudo make install