error: no such file to load — readline (LoadError)

I was getting this error trying to start the rails console: error: no such file to load — readline (LoadError).  I’m using rvm, rails3, ruby 1.9.2, Ubuntu 10.04.

I tracked down redline in my ruby source ~/.rvm/src/ruby-1.9.2-p0/ext/readline and ran:

ruby extconf.rb

This let me know I was missing these two packages:

libncurses5-dev and libreadline5-dev

sudo apt-get install libncurses5-dev libreadline5-dev

Then run the command from before:

ruby extconf.rb

You should get all passing.

make
make install

Rails c now works!

This entry was posted in Uncategorized and tagged , , , , . Bookmark the permalink.

22 Responses to error: no such file to load — readline (LoadError)

  1. Zachary says:

    Thank you sir! Solved the exact problem I was having.

  2. jess says:

    this also works with ruby 1.8.7 and rails 2.x

  3. w4ik says:

    I just spent abt 2 hours trying to solve this problem…thanks much for posting this fix…to me…it also shed some light on methods for troubleshooting future/similar issues

  4. Francisco Lopes says:

    Thank you very much. This text solved my problem.

  5. Alice says:

    Thank you! This was a big help! Helped resolve my issue as well :-)

  6. Kleber says:

    Nice! solved my problem too.

    Thank you!

  7. Marius says:

    Crappy ubuntu, this one did helped.
    Thx a lot.

  8. Tiago Franco says:

    Thanks!!!!!

    My Ubuntu machine start throwing this error after updating ruby to 1.9.2-136. Took me a while to land here and fix the issue.

  9. Serge says:

    Solved for rvm, rails3, ruby 1.8.7, Ubuntu 10.10.
    Thank you

  10. Sokolov V. says:


    I hope this site will help someone with a problem they can’t seem to solve and add to their education.

    Thanks a lot! It’s really help ;)

  11. Biff says:

    Worked like a charm! I’m also on rvm, rails3, ruby 1.9.2, Ubuntu 10.04.
    A big thank you for posting this.

  12. Wylie says:

    Thanks!
    This also fixed ruby-debug19 for me in RVM/Rails 3/Ruby 1.9.2 on Ubuntu 10.04.
    Now rails s -u works!

  13. Christian says:

    You’re a superstar – solved my problem after hours of looking! Ubuntu 10.04 Ruby 1.9.2-p180 rails 3.0.5

  14. Swathi says:

    Thanks! That saved me a lot of time

  15. ckgagan says:

    Nice.. this solved my problem.. :)

  16. Rockwell says:

    Thank you, thank you, thank you. Much simpler than having to recompile ruby.

  17. Ketzer says:

    Thanks a lot!!!! from Russia!!!
    This fix problem with Ubuntu 11.10 + Rails 3.1.0 + Ruby 1.9.2p290

  18. Daniel says:

    Thanks mate! Better solution that the one I found in stack overflow.

  19. Pingback: Ruby 02-12-2012 | Techdot Internet Relay Chat Resources, Logs, and Records.

  20. Jeff says:

    thank’s for this post. it works even in rails 3.1.3 with ruby 1.9.2..

  21. Andrew says:

    You rock, man.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>