无法从ubuntu upgrade 9.10运行脚本/控制台 - > 10.04

时间:2011-03-10 04:45:37

标签: ruby-on-rails ruby rubygems ubuntu-10.04

我刚刚将我的ubuntu从9.10升级到10.04, 在升级之前一切都很好,但升级后我不能 更长的脚本/控制台。

Loading development environment (Rails 2.3.10)
/usr/local/lib/site_ruby/1.9.1/rubygems.rb:779:in 
`report_activate_error':Gem::LoadError: RubyGem version error: 
rails(2.3.4 not = 2.3.10)

/usr/lib/ruby/1.9.1/irb/init.rb:264:in `require':LoadError: no such file 
to load -- console_app
/usr/lib/ruby/1.9.1/irb/init.rb:264:in `require':LoadError: no such file 
to load -- console_with_helpers
# gem -v
1.5.2
# ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
# rails -v
Rails 2.3.10
到目前为止谷歌帮助不大:(

更新: 尝试了几个选项后,我更新到了10.10,现在出现了以下错误

$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]
$ gem -v
1.6.2
$ rails -v
Rails 2.3.10

$ gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.6.2
  - RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i686-linux]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/1.9.1
     - /home/recmend/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/
$ whereis ruby
ruby: /usr/bin/ruby1.8 /usr/bin/ruby /usr/lib/ruby /usr/local/bin/ruby /usr/local/lib/ruby /usr/share/man/man1/ruby.1.gz
$ whereis gem
gem: /usr/bin/gem /usr/local/bin/gem

$ script/console 
Loading development environment (Rails 2.3.10)
/usr/local/lib/site_ruby/1.9.1/rubygems/source_index.rb:68:in `installed_spec_directories': undefined method `path' for Gem:Module (NoMethodError)
    from /usr/local/lib/site_ruby/1.9.1/rubygems/source_index.rb:58:in `from_installed_gems'
    from /usr/local/lib/site_ruby/1.9.1/rubygems.rb:883:in `source_index'

关闭下一个问题...

1 个答案:

答案 0 :(得分:1)

问题出在您的Rubies版本中。你看:

$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]

但是 加载开发环境(Rails 2.3.10)/usr/local/lib/site_ruby/1.9.1/rubygems.rb:779:in

它试图加载1.9.1及其所有宝石。

你可以在这做什么。

  1. which ruby将返回您的Ruby 1.9.2目录
  2. 将其添加到您的路径export PATH=/your/ruby1.9.2/dir/bin:$PATH
  3. 享受:)