in News, Quid Pro Quo

Ruby Gem 1.0 is out

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.

11 Comments

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

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

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

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

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

Comments are closed.