RubyGems - update made a mess - help needed with Windows

B

Becca Girl

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!!!!
 
L

Luis Lavena

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,
 
B

Becca Girl

Luis Lavena wrote:

Thanks for the help. Notes are below.
1) Which version of Ruby (ruby -v) you have installed?

ruby 1.8.5

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

Rails 2.1

3) 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)

4) 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!!!!!
 
L

Luis Lavena

Luis Lavena wrote:

Thanks for the help.  Notes are below.


ruby 1.8.5




Rails 2.1




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




Same error as above.


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

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

3) 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.

4) RubyGems should be working now.
THANKS Again for your help.  So very much appreciated!!!!!

HTH,
 
B

Becca Girl

Luis said:
4) 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?
 
R

Ryan Davis

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

Ryan Davis

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

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

3) 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.

4) 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?
 
B

Becca Girl

Ryan said:
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!
 
R

Ryan Davis

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?

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).
 
B

Becca Girl

Ryan said:
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
 
B

Becca Girl

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

Luis Lavena

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 :)

HTH,
 
L

Luis Lavena

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! :)

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

Regards,
 
L

Luis Lavena

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

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

Becca Girl

Luis said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top