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

发布于 2024-10-21 07:21:52 字数 2009 浏览 1 评论 0原文

我刚刚将我的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'

请转到下一个问题...

I just upgraded my ubuntu from 9.10 to 10.04,
before the upgrade everything was fine, but after the upgrade I can no
longer run script/console.

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

Google was not much help so far :(

Update:
After trying several options, I updated to 10.10 and now getting following errors

$ 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'

Off to next problem...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦初启 2024-10-28 07:21:52

问题出在您的 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 及其所有 gem。

你可以在这里做什么。

  1. which ruby​​ 将返回您的 Ruby 1.9.2 目录,
  2. 将其添加到您的 PATH export PATH=/your/ruby1.9.2/dir/bin:$PATH

享受吧:)

the problem is in your Rubies versions. You see:

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

but
Loading development environment (Rails 2.3.10) /usr/local/lib/site_ruby/1.9.1/rubygems.rb:779:in

It is trying to load 1.9.1 with all its gems.

What you can do here.

  1. which ruby will return your Ruby 1.9.2 dir
  2. add it into your PATH export PATH=/your/ruby1.9.2/dir/bin:$PATH

enjoy :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文