升級(jí)ruby和rails后進(jìn)入script/consle出現(xiàn):
復(fù)制代碼 代碼如下:
/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require': no such file to load -- readline (LoadError)
from /usr/local/lib/ruby/1.8/irb/completion.rb:10
from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `require'
from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `each'
from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `load_modules'
from /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup'
from /usr/local/lib/ruby/1.8/irb.rb:54:in `start'
from /usr/local/bin/irb:13
解決辦法:
第一步:確認(rèn)是否安裝了libncurses5-dev libreadline5-dev ,如果沒(méi)有安裝,就用
復(fù)制代碼 代碼如下:
sudo apt-get install libncurses5-dev libreadline5-dev 進(jìn)行安裝
第二步:
復(fù)制代碼 代碼如下:
cd /usr/src/ruby-1.8.7/ext/readline
ruby extconf.rb
make
sudo make install
您可能感興趣的文章:- Ruby對(duì)比Python的優(yōu)勢(shì)和劣勢(shì)
- Ruby元編程技術(shù)詳解(Ruby Metaprogramming techniques)
- Ruby編程中關(guān)于中斷和返回的用法教程