RubyGem 1.0 is out.
Yeah!
Which means that if you see
undefined method `require_gem' for main:Object (NoMethodError)
You’ll need to replace require_gem by just gem.
For example, unless you have the very latest version of ruby-debug (0.9.3), you’ll see the above error. In that case, though, updating your gem is simpler.
Thanks for the fix! But why doesn’t simply updating capistrano via the gem command work?
Where do I replace ‘require_gem’ by just gem?
Dave,
anywhere it is being used. You’ll get an error when require_gem is used. In most cases, updating to the latest gem should do it.
Sorry, I should have mentioned that I am getting it while trying to use rake.
admin$ rake db:migrate
/usr/local/bin/rake:17: undefined method `require_gem’ for main:Object (NoMethodError)
:~ admin$ gem -v
1.0.1
admin$ ruby -v
ruby 1.8.4 (2005-12-24) [i686-darwin8.11.1]
On Mac OS X Tiger
Try running rake with—trace. This should give you more information on where that call to require_gem is.
And if you have not done so already, upgrading rake to 0.8.1 would be a good idea.
Thank you, that worked.
For anybody else with the same problem, run this command to bring rake up to date:
Good to hear. I’m sure you won’t be the only one with that error.
Thanks that helped me too!
where do you enter the sudo gem install…. command?
within ur app directory? i’m using instant rails on windows and having a bitch of a time setting up…..
I’m not too familiar with ruby/rails on windows, and more specifically how instant rails sets things up, but you should not need to use sudo. Most likely just “gem install …”
This command can be run from anywhere and should know where gems are stored