Readline 错误阻止我运行 Rails 控制台

发布于 2024-12-12 03:41:01 字数 1419 浏览 0 评论 0原文

我的环境是rails 3.1,ruby 1.9.2,rvm,Xubuntu 11.10。

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

所以我尝试将 readline 作为 RVM 中的包安装,但这是我收到的错误:

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 。

谁能指出我正确的方向。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冰之心 2024-12-19 03:41:01

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

rvm uninstall 1.9.2
sudo apt-get install libreadline-dev
rvm install 1.9.2 --with-readline-dir=/usr/include/readline

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
无语# 2024-12-19 03:41:01

我已经使用以下命令重新安装了 ruby​​ 1.9.2,指向我的系统版本的 readline:

rvm install 1.9.2 --with-readline-dir=/usr/include/readline

这似乎已经解决了我的问题,现在一切正常。

Rob

另外值得注意的是,rvm github 站点上存在匹配问题,应该很快就会修复:
https://github.com/wayneeseguin/rvm/issues/515

I've reinstall ruby 1.9.2 pointing at my system version of readline using this command:

rvm install 1.9.2 --with-readline-dir=/usr/include/readline

That seems to have fixed my problem and everything is now working.

Rob

Also worth noting that a matching issue exists on the rvm github site and it should be fixed soon:
https://github.com/wayneeseguin/rvm/issues/515

只为一人 2024-12-19 03:41:01

Ubuntu 11.10。
对我来说以下工作有效:
首先安装rvm。
然后安装rvm要求的所有内容
然后安装 1.9.3 或其他版本。

Ubuntu 11.10.
For me the following worked:
First install rvm.
Then install everything from rvm requirements
Then install 1.9.3 or whatever.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文