Gem Install problems...

Jeff's Avatar

Jeff

11 Mar, 2011 04:28 PM

I have been trying to get gem to update on my Mac OSX and kept getting the 302 error that the source wasn't valid.

I found instructions to download and upgrade manually and it basically involved downloading the zip, cd to the directory and run ruby setup.rb

But I get this error:

ruby setup.rb
./lib/rubygems/custom_require.rb:54: warning: parenthesize argument(s) for future version ./lib/rubygems/custom_require.rb:57:in require': undefined methodend_with?' for no such file to load -- Win32API (NoMethodError)

from ./lib/rubygems/config_file.rb:55
from ./lib/rubygems/custom_require.rb:36:in `gem_original_require'
from ./lib/rubygems/custom_require.rb:36:in `require'
from ./lib/rubygems/gem_runner.rb:8
from ./lib/rubygems/custom_require.rb:36:in `gem_original_require'
from ./lib/rubygems/custom_require.rb:36:in `require'
from setup.rb:25

This is for a class and I've been banging away at it for a week now... any help would be appreciated as the class technically ends tonight and I haven't gotten confirmation that I've been granted an extension. Thanks in advance!

  1. Support Staff 1 Posted by Luis Lavena on 11 Mar, 2011 06:21 PM

    Luis Lavena's Avatar

    Please check that RubyGems source is http://rubygems.org and not
    http://gems.rubyforge.org

    gems.rubyforge.org is generating a 302 redirect and old versions of
    RubyGems can't handle it.

    Also, seems you have Ruby 1.8.6, that is no longer supported by newer
    version of RubyGems, you need Ruby 1.8.7 at minimum.

  2. 2 Posted by Jeff on 11 Mar, 2011 07:10 PM

    Jeff's Avatar

    Well according to www.rubyonrails.org all I'm supposed to do is do a:

    gem update rails

    beacuse its included with MacOSX developer tools..

    But then I get the 302 problem again. I've tried doing the gem add thingy but it gives me another 302 error. How can I update Mac's rails?

  3. Support Staff 3 Posted by Luis Lavena on 11 Mar, 2011 07:19 PM

    Luis Lavena's Avatar

    $ ruby -v
    ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

    $ gem sources
    *** CURRENT SOURCES ***

    http://gems.rubyforge.org/

    $ gem sources --add http://rubygems.org/
    http://rubygems.org/ added to sources

    $ gem sources --remove http://gems.rubyforge.org/
    http://gems.rubyforge.org/ removed from sources

  4. 4 Posted by Jeff on 11 Mar, 2011 07:46 PM

    Jeff's Avatar

    My version is 1.8.6 as you thought... and the source shows as you have indicated...

    however when I do the add... I get this error:

    gem sources --add http://rubygems.org/
    ERROR: While executing gem ... (Gem::RemoteSourceException)

    HTTP Response 302 fetching http://rubygems.org/yaml
    

    and if I try the remove first I get:

    gem sources --remove http://gems.rubyforge.org
    ERROR: While executing gem ... (Gem::RemoteSourceException)

    HTTP Response 302 fetching http://gems.rubyforge.org/yaml
    
  5. Support Staff 5 Posted by Eric Hodel on 15 Mar, 2011 11:44 PM

    Eric Hodel's Avatar

    Your rubygems version is too old, you will need to follow the manual upgrade process. 1.3.7 is the latest version of RubyGems which supports ruby 1.8.6.

    http://rubygems.rubyforge.org/rubygems-update/UPGRADING_rdoc.html

  6. 6 Posted by Jeff on 16 Mar, 2011 01:09 AM

    Jeff's Avatar

    I am aware it is too old, it's the upgrade process that is causing me problems.

    per your link I have:

    1:

    sudo gem install rubygems-update
    Password:
    ERROR: While executing gem ... (Gem::RemoteSourceException)

    HTTP Response 302 fetching http://gems.rubyforge.org/yaml
    

    and

    2: manual install from the link... but the version at the link is 1.6.2... so I dont understand why people keep giving me that link as the versions you guys are mentioning are all different. But following your link and instructions anyway I get:

    ruby setup.rb
    ./lib/rubygems/custom_require.rb:54: warning: parenthesize argument(s) for future version ./lib/rubygems/custom_require.rb:57:in require': undefined methodend_with?' for no such file to load -- Win32API (NoMethodError)

    from ./lib/rubygems/config_file.rb:55
    from ./lib/rubygems/custom_require.rb:36:in `gem_original_require'
    from ./lib/rubygems/custom_require.rb:36:in `require'
    from ./lib/rubygems/gem_runner.rb:8
    from ./lib/rubygems/custom_require.rb:36:in `gem_original_require'
    from ./lib/rubygems/custom_require.rb:36:in `require'
    from setup.rb:25
    

    Still no success. I'm really confused and am beginning to think this isn't going to work before my class extension ends now, lol. I know other people can use it, so what could I be doing wrong?

  7. Support Staff 7 Posted by Luis Lavena on 16 Mar, 2011 02:08 AM

    Luis Lavena's Avatar

    Download RubyGems 1.3.7:

    http://rubyforge.org/frs/?group_id=126

    You will need to scroll down until you see the file. or:

    wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
    tar xf rubygems-1.3.7.gz
    cd rubygems-1.3.7
    sudo ruby setup.rb

  8. 8 Posted by aleffe on 09 Apr, 2012 07:31 PM

    aleffe's Avatar

    Excellent! I had the exact same problem with MacOSX Tiger. Now gem works. Thanks Luis!

  9. 9 Posted by Daniel Canet on 30 Jun, 2012 01:57 PM

    Daniel Canet's Avatar

    Thanks Luis and Jeff!!
    You saved my day.

  10. Nick Quaranto closed this discussion on 04 Aug, 2012 02:49 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac