`

ruby 1.9 irb rails console不能用readline问题

阅读更多
Update: 2012/03/27
当前版本ruby1.9.3p135
ubuntu 11.10

解决办法先试试
rvm requirements
#先安装依赖的包
rvm remove 1.9.2
rvm install 1.9.2

遇到问题是rvm use用不了,其他都能用,提示
引用
RVM is not a function, selecting rubies with 'rvm use ...' will not work.

是一个所谓的“Run as login shell”问题,官方有介绍https://rvm.beginrescueend.com/integration/gnome-terminal/
实际设计多用户登录什么的问题,就是把如下放到.bashrc,不要放到其他什么bash_profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

source ~/.bashrc

问题现象就是

引用

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.



标准的解决办法是
https://rvm.beginrescueend.com/packages/readline/

问题是我一进行到这一步就有问题
$ cd $HOME/.rvm/src/ruby-1.9.2-p0/ext/readline
$ ruby extconf.rb -- --with-readline-dir="$HOME/.rvm/usr"


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


后来发现两个问题:
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

引用
undefined symbol: UP

ls /usr/local/lib

su
mkdir temp
mv /usr/local/lib/libreadline* temp
ldconfig
apt-get update

rm -rf /usr/local/lib/temp
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics