views:

547

answers:

2

Hi all. Could you plz explain me how to correct this problem. I've installed rails edge on perfect working with 2.3.3 application and on attempt to launch server i've got (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'
..........................

after upgrading to 1.8.7 i've got

$ 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

any ideas?

A: 

Have you checked your RubyGems version it should be > 1.3.1 ?

If yes,Please try installing it again.

A lots of people seem to be having the same problem recently. It seemed to have worked for people who have reinstalled there ruby , rubygems installation using MacPorts.

Rishav Rastogi
hi,gem 1.3.5, reinstalled - the same result :( from rubygems with update by gem update --system
Alexey Poimtsev
A: 

It sounds like the gems are not installed for the new version of Ruby, or that your path settings need updating.

From http://rubygems.org/read/chapter/19#page98:

  • Check that the installation of Ruby that is running is the same one that has RubyGems installed. On a unix system, the which command (or type command) will help figure this out.

  • Verify that the currently running installation of Ruby does indeed have the RubyGems library installed. You should find a “rubygems.rb” file in the site_ruby/1.8 directory of the Ruby installation.

These mixup can easily happen after installing a new instance of Ruby, but the old instance preceeds the new one in the PATH list.

How did you install your new version of Ruby, and has the PATH environment variable been adjusted correctly (echo $PATH)?

Presumably when you run which gem and which ruby, they point to the new 1.8.7 location? ruby -v and gem -v will confirm this.

Olly