Console broken

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

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

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?

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! :frowning:

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

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

Ilan B. wrote:

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

hope this helps

It did - Thanks.

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs