Readline在rvm中不起作用 - Ubuntu 11.10

Say*_*yuj 12 ruby readline rvm

我在我的ubyntu 11.10上使用rvm.我的readline无法正常工作,我试过ruby extconf.rb但它没有通过.输出如下:

$ ruby extconf.rb 
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
Run Code Online (Sandbox Code Playgroud)

我尝试安装libncurses5-dev和libreadline5-dev

$ sudo apt-get install libncurses5-dev libreadline5-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libreadline5-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libreadline-gplv2-dev:i386 lib64readline-gplv2-dev:i386 libreadline-gplv2-dev

E: Package 'libreadline5-dev' has no installation candidate
Run Code Online (Sandbox Code Playgroud)

这里有什么问题?有人可以帮忙吗?

zze*_*roo 21

与此相同的问题Readline错误阻止我运行rails控制台

在ubuntu下,您可以使用系统readline安装.

rvm uninstall ${YOURUBYVERSION}
sudo apt-get install libreadline-dev
rvm install ${YOURUBYVERSION} --with-readline-dir=/usr/include/readline
Run Code Online (Sandbox Code Playgroud)

用您想要的ruby版本替换$ {YOURUBYVERSION}.


Say*_*yuj 7

我得到了解决方案:

运行命令

rvm requirements
Run Code Online (Sandbox Code Playgroud)

它显示了要求和依赖关系.安装它们并在rvm上重新安装ruby

rvm remove 1.9.2
rvm install 1.9.2
Run Code Online (Sandbox Code Playgroud)

有用!


apb*_*apb 5

出于某种原因,我不能评论@ zzeroo的答案,但我想提请注意他正在使用的事实

 --with-readline-dir=/usr/include/readline
Run Code Online (Sandbox Code Playgroud)

代替

--with-readline-dir=$rvm_path/usr
Run Code Online (Sandbox Code Playgroud)

我把头撞在墙上很长一段时间,并改变这个固定它为我.