no such file to load -- readline解决办法

升级ruby和rails后进入script/consle出现:
Java代码
  1. /usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require': no such file to load -- readline (LoadError)  
  2.         from /usr/local/lib/ruby/1.8/irb/completion.rb:10  
  3.         from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `require'  
  4.         from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `load_modules'  
  5.         from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `each'  
  6.         from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `load_modules'  
  7.         from /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup'  
  8.         from /usr/local/lib/ruby/1.8/irb.rb:54:in `start'  
  9.         from /usr/local/bin/irb:13  
解决办法:
  第一步:确认是否安装了libncurses5-dev libreadline5-dev ,如果没有安装,就用
   sudo apt-get install libncurses5-dev libreadline5-dev 进行安装
  第二步:
Java代码
  1.     
  2. 1. cd /usr/src/ruby-1.8.7/ext/readline  
  3. 2. ruby extconf.rb  
  4. 3. make  
  5. 4. sudo make install   
posted @ 2009-07-14 20:57  麦飞  阅读(1053)  评论(0编辑  收藏  举报