osx上的边缘导轨和宝石问题

时间:2009-08-10 07:01:38

标签: ruby-on-rails ruby rubygems

你可以解释一下如何纠正这个问题。我已经安装了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 

任何想法?

2 个答案:

答案 0 :(得分:0)

你有没有检查过RubyGems版本> 1.3.1?

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

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

答案 1 :(得分:0)

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

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

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

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

  •   
     

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

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

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