代码之家  ›  专栏  ›  技术社区  ›  Tommy B.

Rails Rack 1.0错误

  •  4
  • Tommy B.  · 技术社区  · 15 年前

    尝试启动脚本/服务器时出现此错误:

    /opt/ruby1.8/lib/ruby/site_ruby/1.8/rubygems.rb:827:in `report_activate_error': RubyGem version error: rack(1.0.0 not ~> 1.0.1) (Gem::LoadError)
     from /opt/ruby1.8/lib/ruby/site_ruby/1.8/rubygems.rb:261:in `activate'
     from /opt/ruby1.8/lib/ruby/site_ruby/1.8/rubygems.rb:68:in `gem'
     from /opt/ruby1.8/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller.rb:34
     from /opt/ruby1.8/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
     from /opt/ruby1.8/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
     from /opt/ruby1.8/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
     from /opt/ruby1.8/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
     from /opt/ruby1.8/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
     from /opt/ruby1.8/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:2
     from /opt/ruby1.8/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
     from /opt/ruby1.8/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
     from script/server:3
    

    这很烦人,因为,我确实做到了:

    Successfully installed rack-1.1.0
    1 gem installed
    Installing ri documentation for rack-1.1.0...
    Installing RDoc documentation for rack-1.1.0...
    

    但它总是说这个错误。我有Rails 2.3.5,但我不认为这个错误与Rails相关,但更像是与服务器相关的LOL。

    谢谢你的帮助!

    2 回复  |  直到 14 年前
        1
  •  11
  •   Simone Carletti    15 年前

    您安装了机架1.1.0,所需版本为1.0.x。

    $ gem uninstall rack
    $ gem install rack -v 1.0.1
    
        2
  •  0
  •   Andrew Degenhardt    14 年前

    以上工作正常,安装时必须注明版本:“-v 1.0.1”

    因为某些原因,它不能工作否则。