ruby 1.9 irb rails console不能用readline问题
发布日期:2021-09-29 20:09:25 浏览次数:4 分类:技术文章

本文共 2021 字,大约阅读时间需要 6 分钟。

[color=darkred]Update: 2012/03/27[/color]
当前版本ruby1.9.3p135
ubuntu 11.10
解决办法先试试
rvm requirements #先安装依赖的包 rvm remove 1.9.2 rvm install 1.9.2
遇到问题是rvm use用不了,其他都能用,提示
[quote]RVM is not a function, selecting rubies with 'rvm use ...' will not work.[/quote]
是一个所谓的“Run as login shell”问题,官方有介绍[url]https://rvm.beginrescueend.com/integration/gnome-terminal/[/url]
实际设计多用户登录什么的问题,就是把如下放到.bashrc,不要放到其他什么bash_profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
source ~/.bashrc
问题现象就是
[quote]
Readline was unable to be required, if you need completion or history install readline then reinstall the ruby.
You may follow 'rvm notes' for dependencies and/or read the docs page https://rvm.beginrescueend.com/packages/readline/ . Be sure you 'rvm remove X ; rvm install X' to re-compile your ruby with readline support after obtaining the readline libraries.
[/quote]
标准的解决办法是
[url]https://rvm.beginrescueend.com/packages/readline/[/url]
问题是我一进行到这一步就有问题
$ cd $HOME/.rvm/src/ruby-1.9.2-p0/ext/readline $ ruby extconf.rb -- --with-readline-dir="$HOME/.rvm/usr"
[quote]checking for tgetnum() in -lncurses... yes
checking for readline/readline.h... yes
checking for readline/history.h... yes
checking for readline() in -lreadline... no
[/quote]
后来发现两个问题:
1. 路径
ruby extconf.rb -- --with-readline-dir='/home/ra/.rvm/usr/include/readline'
一个是没有装
sudo aptitude install libreadline-dev sudo aptitude install libreadline5-dev libncurses5-dev
够新的呢要换6
sudo aptitude install libreadline6-dev
1.9.3参考
rvm pkg install openssl #older format - rvm package install openssl rvm pkg install iconv #older format - rvm package install iconv rvm pkg install readline#rails console缺少的lib rvm remove 1.9.3 rvm install 1.9.3 -C --with-openssl-dir=\$HOME/.rvm/usr,--with-iconv-dir=\$HOME/.rvm/usr, --with-readline-6.2-dir=\$HOME/.rvm/usr rvm 1.9.3 --default
还是ubuntu的readline error
[quote]undefined symbol: UP[/quote]
ls /usr/local/lib su mkdir temp mv /usr/local/lib/libreadline* temp ldconfig apt-get update rm -rf /usr/local/lib/temp

转载地址:https://blog.csdn.net/horace_lee/article/details/84088102 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:关于json
下一篇:ruby 1.9 简单的文件操作

发表评论

最新留言

能坚持,总会有不一样的收获!
[***.219.124.196]2024年04月16日 05时46分08秒