RubyGems - update made a mess - help needed with Windows

I just did a system update of RubyGems and it just broke my rake test. I
get a message saying that there is no such file to load …/initializer.

I’m wondering what the best thing to do would be. This project is in
svn, but I don’t think that just dropping the rails directory and
reverting will solve the problem since there are a number of files that
sit in the ruby\bin directory that are part of ruby, not svn.

So how can I clean up the mess that I just made?

Thanks!!!

On Jul 31, 11:39 pm, Becca G. [email protected] wrote:

I just did a system update of RubyGems and it just broke my rake test. I
get a message saying that there is no such file to load …/initializer.

I’m wondering what the best thing to do would be. This project is in
svn, but I don’t think that just dropping the rails directory and
reverting will solve the problem since there are a number of files that
sit in the ruby\bin directory that are part of ruby, not svn.

So how can I clean up the mess that I just made?

Ok, first let’s shed some light into this, with simple questions.

  1. Which version of Ruby (ruby -v) you have installed?

  2. Which version of Rails was your application built with (you can
    check that into config/environement.rb)

  3. Did RubyGems system update succeed? (gem update --system). can you
    provide your gem environment? (gem env)

  4. please indicate the version of Rails gem you have now installed
    (gem list rails)

What you broke is your environment, not your application code, unless
you committed some changes related to the rails gem updates.

With the previous information we can be more helpful, without we will
be guessing.

Regards,

Luis L. wrote:

Thanks for the help. Notes are below.

  1. Which version of Ruby (ruby -v) you have installed?

ruby 1.8.5

  1. Which version of Rails was your application built with (you can
    check that into config/environement.rb)

Rails 2.1

  1. Did RubyGems system update succeed? (gem update --system). can you
    provide your gem environment? (gem env)

I believe that the gem update worked, but if I do ‘gem env’ I get
"unititialized constant Gem::GemRunner (NameError)

  1. please indicate the version of Rails gem you have now installed
    (gem list rails)

Same error as above.

What you broke is your environment, not your application code, unless
you committed some changes related to the rails gem updates.

Yes, I believe my environment is broken, not the code.

THANKS Again for your help. So very much appreciated!!!

Becca G. wrote:

"unititialized constant Gem::GemRunner (NameError)

in /usr/bin/gem add require ‘rubygems/gem_runner’ after require
‘rubygems’

On Aug 1, 12:25 am, Becca G. [email protected] wrote:

  1. Which version of Rails was your application built with (you can
    "unititialized constant Gem::GemRunner (NameError)

Yes, I believe my environment is broken, not the code.

Ok, first it seems the application was not started by you, but you
just checkout it, right? so we need to fix the rubygems stuff.

  1. Download rubygems-1.2.0.zip file from RubyForge:

http://rubyforge.org/frs/?group_id=126&release_id=23118

  1. Extract the package and from the command prompt, inside the folder
    run:

ruby setup.rb install

That should overwrite the installed rubygems with this one.

  1. Go to into your Ruby/bin folder (usually C:\Ruby\bin or C:\Program
    Files\Ruby\bin) and look for all the scripts named “gem”, if you had
    1.8.5, you should have:

gem
gem.bat
gem.cmd

Please remove the gem.cmd file to avoid conflicts.

  1. RubyGems should be working now.

THANKS Again for your help. So very much appreciated!!!

HTH,

Luis L. wrote:

  1. RubyGems should be working now.

Thanks for the great, great instructions and help. So now, if I run
‘rake test’, the message that I get is rake.bat:24: undefined method
‘require_gem’ for main:Object (NoMethodError)

Any thoughts?

On Jul 31, 2008, at 23:04 , Luis L. wrote:

ruby setup.rb install

Please remove the gem.cmd file to avoid conflicts.

  1. RubyGems should be working now.

This is a really good fix-it list for windows users. Luis, can you add
this to the README or a FAQ-WINDOWS or something?

Ryan D. wrote:

require_gem was deprecated long long ago… that must be an old
rake.bat. I suggest nuking it and another loop through Luis’
instructions to ensure you get a fresh copy and everything is happy.

Hi Ryan -

I don’t want to make another mess, so could you please be specific as to
what I need to remove from my system to get this all to work? Do I
simply remove the rake.bat file? Then what’s next to get rake working?

Thanks!

On Aug 1, 2008, at 07:09 , Becca G. wrote:

Luis L. wrote:

  1. RubyGems should be working now.

Thanks for the great, great instructions and help. So now, if I run
‘rake test’, the message that I get is rake.bat:24: undefined method
‘require_gem’ for main:Object (NoMethodError)

require_gem was deprecated long long ago… that must be an old
rake.bat. I suggest nuking it and another loop through Luis’
instructions to ensure you get a fresh copy and everything is happy.

On Aug 1, 2008, at 12:29 , Becca G. wrote:

working?
I don’t use windows… buyer beware.

I think you should remove that bat file and anything else rubygems in
the same directory and repeat steps 2-3 in Luis’ instructions. If the
problem persists, then something is legitimately fubar in rubygems (I
doubt it–Luis has been awesome helping with windows support).

After reading a few more things online, I just opened up my rake.bat
file and modified the script from ‘require_gem’ to ‘gem’ and am able to
run my ‘rake test’ command.

Is this a hack that shouldn’t be done or is this a proper thing to do?

Thanks for all of the great help.

Ryan D. wrote:

I don’t use windows… buyer beware.

I think you should remove that bat file and anything else rubygems in
the same directory and repeat steps 2-3 in Luis’ instructions. If the
problem persists, then something is legitimately fubar in rubygems (I
doubt it–Luis has been awesome helping with windows support).

This is the list of files that appear to be related to rubygems. Do I
delete all of these files and then repeat steps 2-4?

gem
gem.bat
gemhelp.bat
gemlock
gemlock.bat
gemlock.cmd
gemri
gemri.bat
gemri.cmd
gemwhich
gemwhich.bat
gemwhich.cmd
gem_mirror
gem_mirror.bat
gem_mirror.cmd
gem_server
gem_server.bat
gem_server.cmd

On Aug 1, 4:09 pm, Becca G. [email protected] wrote:

Luis L. wrote:

  1. RubyGems should be working now.

Thanks for the great, great instructions and help. So now, if I run
‘rake test’, the message that I get is rake.bat:24: undefined method
‘require_gem’ for main:Object (NoMethodError)

Any thoughts?

Looks like by the line number, your rake is old.

Please remove rake gem and install it again (confirm removal):

gem uninstall rake

And the install it again:

gem install rake

And you should be good to go :slight_smile:

HTH,

On Aug 1, 9:08 pm, Ryan D. [email protected] wrote:

gem
gem.bat
gem.cmd

Please remove the gem.cmd file to avoid conflicts.

  1. RubyGems should be working now.

This is a really good fix-it list for windows users. Luis, can you add
this to the README or a FAQ-WINDOWS or something?

I will! :slight_smile:

I should blog more often… but you know, life always is in the way :-
P

Regards,

On Aug 1, 11:27 pm, Becca G. [email protected] wrote:

gemwhich.bat
gemwhich.cmd
gem_mirror
gem_mirror.bat
gem_mirror.cmd
gem_server
gem_server.bat
gem_server.cmd

Those files are left-overs of previous version of rubygems, you can
safely remove those and install RubyGems on top which will only create
gem and gem.bat for you.

On the rake issue, the require_gem was deprecated as Ryan commented,
but also the rake.cmd file you had was old.

This can be easily solve by removing the old gem of rake and
reinstalling it again.

gem uninstall rake

and then:

gem install rake

If you find other problems when you call some gems directly, is mostly
because you have a old batch file (.bat or .cmd).

Hope this helps and please apologize the delay on my reply.

Luis L. wrote:

Hope this helps and please apologize the delay on my reply.

This all worked great!!! Thanks so much for your time to help me with
everything.