# Console broken

**URL:** <https://www.ruby-forum.com/t/console-broken/75126>\
**Category:** Rails\
**Created:** [November 7, 2006, 5:50pm UTC](https://www.ruby-forum.com/t/console-broken/75126 "2006-11-07T17:50:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [November 7, 2006, 5:50pm UTC](https://www.ruby-forum.com/t/console-broken/75126/1 "2006-11-07T17:50:19Z")

</div>

I just had to do a reinstall, and somehow something is missing. When I  
try to run ruby script/console, I get the error message  
in `require’: no such file to load – readline

Obviously, I left something out, but I’m not sure what or where to start  
trying to get it fixed.

I know there are a lot of ruby experts here. Could some of you point me  
in the right direction.

As always, thanks in advance  
—Michael

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [November 7, 2006, 6:17pm UTC](https://www.ruby-forum.com/t/console-broken/75126/2 "2006-11-07T18:17:00Z")

</div>

Sounds like you don’t have the readline library or ruby bindings.  
First make sure you have the readline library itself (by whatever means  
is most appropriate for your platform), and then build & install the  
ruby bindings for that (assuming you have the source for ruby handing  
it’s in ext/readline)

Fred

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [November 7, 2006, 9:29pm UTC](https://www.ruby-forum.com/t/console-broken/75126/3 "2006-11-07T21:29:38Z")

</div>

Frederick C. wrote:

> Sounds like you don’t have the readline library or ruby bindings.  
> First make sure you have the readline library itself (by whatever means  
> is most appropriate for your platform), and then build & install the  
> ruby bindings for that (assuming you have the source for ruby handing  
> it’s in ext/readline)

If I write a small program (x = readline; puts x), readline works. Is  
there something else I need?

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [November 7, 2006, 11:33pm UTC](https://www.ruby-forum.com/t/console-broken/75126/4 "2006-11-07T23:33:35Z")

</div>

I had the exact same problem on a fresh install of Ubuntu. As Fred  
mentioned, the readline libs are missing by default.

I stumbled for a while and got lucky with google… went something like  
this but I can’t remember the exact steps…

1. apt-get install build\_essential
2. apt-get install libncurses5-dev libreadline5-dev
3. download ruby 1.8.5 source,
4. edit the ext/setup file to statically import all libs that don’t  
sound like microsoft ones (this step may not be needed but I did it  
anyway)
5. run: configure, make, make install
6. download gems source from rubyforge
7. ruby setup.rb
8. gem install rails

Getting the debian/ubuntu mysql bindings to work with ruby was another  
story entirely! ☹

hope this helps

ilan

Michael S. wrote:

> I just had to do a reinstall, and somehow something is missing. When I  
> try to run ruby script/console, I get the error message  
> in `require’: no such file to load – readline
> 
> Obviously, I left something out, but I’m not sure what or where to start  
> trying to get it fixed.
> 
> I know there are a lot of ruby experts here. Could some of you point me  
> in the right direction.
> 
> As always, thanks in advance  
> —Michael

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [November 7, 2006, 10:08pm UTC](https://www.ruby-forum.com/t/console-broken/75126/5 "2006-11-07T22:08:42Z")

</div>

Slightly confusingly, there’s a difference between the IO#readline  
method, which reads a line from an input device, and the readline  
library which handles stuff like editing a command line, command history  
etc…  
You’re lacking the latter (given that require ‘readline’ fails).  
When this happened to me the other day it was because I didn’t have all  
the headers and so on for libreadline at the point where I built ruby.  
You should be able to get libreadline and associated headers, and then  
rebuild the ruby bindings for libreadline

Fred

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [November 8, 2006, 2:40pm UTC](https://www.ruby-forum.com/t/console-broken/75126/6 "2006-11-08T14:40:45Z")

</div>

Ilan B. wrote:

> Getting the debian/ubuntu mysql bindings to work with ruby was another  
> story entirely! ☹
> 
> hope this helps

It did - Thanks.

What problem are you having with mysql? I did a “gem install mysql” and  
it came up fine.
