【问题标题】:edge rails on osx and gem problemosx和gem问题上的边缘导轨
【发布时间】:2009-08-10 07:01:38
【问题描述】:

请您解释一下如何解决这个问题。我已经安装了 rails edge 以完美使用 2.3.3 应用程序并尝试启动我拥有的服务器(ruby 1.8.6)

$ ruby script/server
=> Booting Mongrel
=> Rails 3.0.pre application starting on http://0.0.0.0:3000
/Library/Ruby/Site/1.8/rubygems.rb:270:in `activate': You have a nil
object when you didn't expect it! (NoMethodError)
You might have expected an instance of Array.
The error occurred while evaluating nil.map
        from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:35:in
`require'
.......................... 

升级到 1.8.7 后,我得到了

$ ruby script/server
./script/../config/../vendor/rails/railties/lib/rails/
vendor_gem_source_index.rb:1:in `require': no such file to load --
rubygems (LoadError)
        from ./script/../config/../vendor/rails/railties/lib/rails/
vendor_gem_source_index.rb:1
        from ./script/../config/../vendor/rails/railties/lib/rails/
gem_dependency.rb:1:in `require'
        from ./script/../config/../vendor/rails/railties/lib/rails/
gem_dependency.rb:1
        from ./script/../config/../vendor/rails/railties/lib/initializer.rb:
6:in `require'
        from ./script/../config/../vendor/rails/railties/lib/initializer.rb:6
        from ./script/../config/boot.rb:45:in `require'
        from ./script/../config/boot.rb:45:in `load_initializer'
        from ./script/../config/boot.rb:38:in `run'
        from ./script/../config/boot.rb:11:in `boot!'
        from ./script/../config/boot.rb:110
        from script/server:2:in `require'
        from script/server:2 

有什么想法吗?

【问题讨论】:

    标签: ruby-on-rails ruby rubygems


    【解决方案1】:

    您是否检查过您的 RubyGems 版本应该是 > 1.3.1 ?

    如果是,请尝试重新安装。

    最近似乎很多人都遇到了同样的问题。它似乎适用于使用 MacPorts 重新安装 ruby​​ 、 ruby​​gems 安装的人。

    【讨论】:

    • 嗨,gem 1.3.5,重新安装 - 相同的结果 :( 来自 ruby​​gems 并由 gem update --system 更新
    【解决方案2】:

    听起来好像没有为新版本的 Ruby 安装 gem,或者您的路径设置需要更新。

    来自http://rubygems.org/read/chapter/19#page98

    • 检查正在运行的 Ruby 安装是否与安装了 RubyGems 的安装相同。在 unix 系统上,which 命令(或 type 命令)将有助于解决这个问题。

    • 验证当前运行的 Ruby 安装是否确实安装了 RubyGems 库。您应该在 Ruby 安装的 site_ruby/1.8 目录中找到“rubygems.rb”文件。

    在安装新的 Ruby 实例后很容易发生这些混淆,但旧实例在 PATH 列表中位于新实例之前。

    您是如何安装新版 Ruby 的,PATH 环境变量是否已正确调整 (echo $PATH)?

    大概当您运行which gemwhich ruby 时,它们会指向新的1.8.7 位置? ruby -vgem -v 将确认这一点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-23
      • 1970-01-01
      • 2021-04-23
      • 1970-01-01
      • 2021-01-09
      • 1970-01-01
      相关资源
      最近更新 更多