Forum: Ruby on Rails script/console error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
ray (Guest)
on 2007-05-06 22:26
(Received via mailing list)
I got the following error when I try to run the console.  It used to
be able to run without problems.

> script/console
Loading development environment.
/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
>

Ray,
Alain R. (Guest)
on 2007-05-06 22:32
(Received via mailing list)
Ray,

  > /usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require': no such
  > file to load -- readline (LoadError)

Have you tried
   http://www.oobaloo.co.uk/articles/2006/03/22/ruby-...
   http://ruphus.com/code/rails/railsonubuntu-howto.html

(found with Google)

Alain
-----
blog.ravet.com
ray (Guest)
on 2007-05-06 23:13
(Received via mailing list)
Thanks for the links.

I found that my ruby was not built with readline support because I
downloaded and installed the latest version 1.8.6, not the Ubuntu
package.  What I did to fix it was to rebuild ruby with readline
support:

./configure --with-readline-dir=/usr/local
make
make install

Now script/console works as expected.  However, before I included the
readline support, irb works but not script/console.  Why?

Ray,
hackathology (Guest)
on 2007-05-10 17:55
ray wrote:
> Thanks for the links.
>
> I found that my ruby was not built with readline support because I
> downloaded and installed the latest version 1.8.6, not the Ubuntu
> package.  What I did to fix it was to rebuild ruby with readline
> support:
>
> ./configure --with-readline-dir=/usr/local
> make
> make install
>
> Now script/console works as expected.  However, before I included the
> readline support, irb works but not script/console.  Why?
>
> Ray,

apt-get install libncurses5-dev libreadline5-dev

cd /ruby-1.8.6/ext/readline

ruby extconf.rb

make

sudo make install
This topic is locked and can not be replied to.