逆时针' Blog

Welcome to 逆时针' Blog

Get the Flash Player to see this player.


/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require': no such file to load -- readline (LoadError)


昨天晚上启动script/console

然后提示我:


/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


然后上网查,找到说要安装libncurses5-dev libreadline5-dev

然后安装发现我已经有了这两个库,然后进入ruby的目录发现有个目录i486-linux下面有readline.so

然后又搜到一位台湾大哥


都是升級惹的禍III
分類:Rails
2007/03/26 19:29
OS: fedora core 5
Ruby是1.8.6
Rails 是1.2.3

今天又要開始寫程式了,結果嚇然發現,我的script/console竟然不會動了,升級前都好好的呀。
它秀出錯誤訊息:
        /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

還好Google 幫我找到解決方法了,有Google真好。

主要的問題出在readline.so這個檔案,也不知道是那裡的問題,解決方法是下這個指令:
 cp /usr/lib/ruby/1.8/i386-linux/readline.so /usr/local/lib/ruby/1.8/i686-linux/readline.so
這樣就解決了,如果看官知道是怎麼回事,請告訴我一下,謝謝。


我发现我和他的问题可能一样,继续搜索,感觉是这样,应该先安装readline然后在编译和安装ruby

找到这个:



Compiling Ruby 1.8.6 on Ubuntu

July 17, 2007 @ 09:26 AM | posted by carmelyne
(last updated: 08.09.07)
Lets do this quickly:

Note: This is not for an upgrade.

   1. cd /usr/src
   2. sudo wget http://rubyforge.org/frs/download.php/18421/ruby-1.8.6.tar.gz
   3. sudo tar -xvf ruby-1.8.6.tar.gz
   4. cd ruby-1.8.6
   5. sudo apt-get install build-essential
   6. ./configure
   7. make test
   8. make
   9. sudo make install
  10. ruby -v (# == ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux])
  11. irb (# make sure irb works)

Then just do a quick update sweep for ubuntu:

   1. apt-get update
   2. apt-get dist-upgrade

UPDATE: Getting script/console to work

Error:
/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require’: no such file to load – readline (LoadError)

Eeek now script/console won't work. So let's fix that. We'll go back to the archive and do the following:

   1. cd /usr/src/ruby-1.8.6/ext/readline
   2. ruby extconf.rb
   3. make
   4. sudo make install

Do I need a disclaimer? Hey! I was on my own too when I did this compile. ;p


知道我用源码还是可以重新搞定这个局部升级的问题的~
添加评论

昵称 *

E-mail

站内搜索

Google

本站收藏资源

  • 在线杀毒大全
  • 可爱日历
  • c++简明教程
  • mysql文档
  • phpbible
  • 高中Flash课件
  • All Ruby Doc
  • O'Reilly Books
  • 友情链接

    都谁访问这里

    Locations of visitors to this page

    站点信息

    行评论

    Copyright © 2004-2007. All Rights Reserved. NISHIZHEN.CN Email:[email protected]  CallMe:13767476647  
    赣ICP备07001442号Google PageRank 


Checker - Page Rank Calculator 点击这里给我发消息