Ruby Gem 1.0 is out

Posted on Thu Dec 20 01:42:00 UTC 2007

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.

Posted in News, Quid Pro Quo  |  Tags  |  11 comments

Comments

  1. YodaYid YodaYid said // Dec 26, 2007 at 03:53 PM

    Thanks for the fix! But why doesn’t simply updating capistrano via the gem command work?

  2. Dave T Dave T said // Jan 16, 2008 at 05:33 PM

    Where do I replace ‘require_gem’ by just gem?

  3. Pascal Pascal said // Jan 16, 2008 at 06:05 PM

    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.

  4. Dave T Dave T said // Jan 16, 2008 at 06:07 PM

    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

  5. Pascal Pascal said // Jan 16, 2008 at 06:19 PM

    Try running rake with—trace. This should give you more information on where that call to require_gem is.

  6. Pascal Pascal said // Jan 16, 2008 at 06:21 PM

    And if you have not done so already, upgrading rake to 0.8.1 would be a good idea.

  7. Dave T Dave T said // Jan 16, 2008 at 07:21 PM

    Thank you, that worked.

    For anybody else with the same problem, run this command to bring rake up to date:

    sudo gem install --remote rake

  8. Pascal Pascal said // Jan 16, 2008 at 08:00 PM

    Good to hear. I’m sure you won’t be the only one with that error.

  9. Jin Jin said // Feb 23, 2008 at 05:10 PM

    Thanks that helped me too!

  10. need rail help need rail help said // Mar 07, 2008 at 03:44 PM

    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…..

  11. Pascal Pascal said // Mar 08, 2008 at 03:48 PM

    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