Ruby 的 ri 不起作用 - “Marshall 数据太短”

Ruby 的 ri 不起作用 - “Marshall 数据太短”

我正在运行 Lubuntu 13.10,我从 apt-get 存储库安装了 Ruby (1.9.3p194)、Gems(1.8.23)、ri(4.1.1)、rdoc 和一些 gem (Rails、RSpec、haml...)。当我尝试运行 ri 时,它给了我以下消息:

$ ri Array
/var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/store.rb:548:in `load': marshal data too short (ArgumentError)
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/store.rb:548:in `block in load_cache'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/store.rb:547:in `open'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/store.rb:547:in `load_cache'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/ri/driver.rb:391:in `block in initialize'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/ri/paths.rb:59:in `block in each'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/ri/paths.rb:58:in `each'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/ri/paths.rb:58:in `each'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/ri/driver.rb:385:in `initialize'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/ri/driver.rb:362:in `new'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/ri/driver.rb:362:in `run'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/bin/ri:12:in `<top (required)>'
        from /usr/local/bin/ri:23:in `load'
        from /usr/local/bin/ri:23:in `<main>'hri Array
/var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/store.rb:548:in `load': marshal data too short (ArgumentError)
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/store.rb:548:in `block in load_cache'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/store.rb:547:in `open'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/store.rb:547:in `load_cache'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/ri/driver.rb:391:in `block in initialize'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/ri/paths.rb:59:in `block in each'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/ri/paths.rb:58:in `each'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/ri/paths.rb:58:in `each'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/ri/driver.rb:385:in `initialize'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/ri/driver.rb:362:in `new'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/lib/rdoc/ri/driver.rb:362:in `run'
        from /var/lib/gems/1.9.1/gems/rdoc-4.1.1/bin/ri:12:in `<top (required)>'
        from /usr/local/bin/ri:23:in `load'
        from /usr/local/bin/ri:23:in `<main>'

我在 Google 上确实没找到任何有用的东西。

问:我该如何解决这个问题,或者如何在 Lubuntu 13.10 上正确安装 Ruby 和 ri Gem?

相关内容