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

···

--
Posted via http://www.ruby-forum.com/.

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,

···

On Jul 31, 11:39 pm, Becca Girl <csch...@yahoo.com> 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?

--
Luis Lavena

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

···

--
Posted via http://www.ruby-forum.com/\.

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.

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,

···

On Aug 1, 12:25 am, Becca Girl <csch...@yahoo.com> wrote:
--
Luis Lavena

Luis Lavena wrote:

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?

···

--
Posted via http://www.ruby-forum.com/\.

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?

···

On Jul 31, 2008, at 23:04 , Luis Lavena wrote:

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.

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 07:09 , Becca Girl wrote:

Luis Lavena wrote:

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)

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, 4:09 pm, Becca Girl <csch...@yahoo.com> wrote:

Luis Lavena wrote:
> 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?

--
Luis Lavena

I will! :slight_smile:

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

Regards,

···

On Aug 1, 9:08 pm, Ryan Davis <ryand-r...@zenspider.com> wrote:

On Jul 31, 2008, at 23:04 , Luis Lavena wrote:

> 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?

--
Luis Lavena

Ryan Davis 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!

···

--
Posted via http://www.ruby-forum.com/\.

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

···

On Aug 1, 2008, at 12:29 , Becca Girl wrote:

Ryan Davis 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.

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?

Ryan Davis 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

···

--
Posted via http://www.ruby-forum.com/\.

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.

···

--
Posted via http://www.ruby-forum.com/.

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.

···

On Aug 1, 11:27 pm, Becca Girl <csch...@yahoo.com> wrote:

Ryan Davis 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

--
Luis Lavena

Luis Lavena 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.

···

--
Posted via http://www.ruby-forum.com/\.