Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Readline errors prevent me running rails console

My environment is rails 3.1, ruby 1.9.2, rvm, Xubuntu 11.10.

When I try to run the rails console within an app, I am getting require errors pointing at readline.

So I am trying to install readline as a package within RVM, but this is the error I am getting:

Applying patch '/home/rob/.rvm/patches/readline-6.2/patch-shobj-conf.diff'...
ERROR: Error running 'patch -p0 -f < /home/rob/.rvm/patches/readline-6.2/patch-shobj-    conf.diff', please read /home/rob/.rvm/log/readline/patch.log
ERROR: Patch /home/rob/.rvm/patches/readline-6.2/patch-shobj-conf.diff did not apply cleanly... back to the patching board :(

The log contains

[2011-10-26 10:16:30] patch -p0 -f < /home/rob/.rvm/patches/readline-6.2/patch-shobj-conf.diff
patching file support/shobj-conf
Hunk #1 FAILED at 157.
1 out of 2 hunks FAILED -- saving rejects to file support/shobj-conf.rej

I've tried

$ rvm pkg install readline
$ rvm remove 1.9.2
$ rvm install 1.9.2 --with-readline-dir=$rvm_path/usr

And

$ cd $HOME/.rvm/src/ruby-1.9.2-p0/ext/readline
$ ruby extconf.rb
$ make install

The latter gives me

checking for tgetnum() in -lncurses... yes
checking for readline/readline.h... yes
checking for readline/history.h... yes
checking for readline() in -lreadline... no
checking for readline() in -ledit... no
checking for editline/readline.h... no

Running 'rails server' works, so I think the problem is just with readline.

Can anyone point me in the right direction.

like image 574
11 revs, 10 users 40% Avatar asked Oct 26 '11 09:10

11 revs, 10 users 40%


1 Answers

Ran into the same problem on Ubuntu 10.0.4 and managed to fix it with:

rvm uninstall 1.9.2
sudo apt-get install libreadline-dev
rvm install 1.9.2 --with-readline-dir=/usr/include/readline
like image 83
meja Avatar answered Oct 16 '22 13:10

meja