Readline 错误阻止我运行 rails 控制台 [英] Readline errors prevent me running rails console

查看:60
本文介绍了Readline 错误阻止我运行 rails 控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的环境是 rails 3.1、ruby 1.9.2、rvm、Xubuntu 11.10.

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

当我尝试在应用程序中运行 rails 控制台时,我收到指向 readline 的 require 错误.

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

所以我试图在 RVM 中安装 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 :(

日志包含

[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

我试过了

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

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

后者给了我

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

运行rails server"是可行的,所以我认为问题仅在于 readline.

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

谁能指出我正确的方向.

Can anyone point me in the right direction.

推荐答案

在 Ubuntu 10.0.4 上遇到同样的问题并设法修复它:

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

这篇关于Readline 错误阻止我运行 rails 控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆