Gem Install problems...
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!
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Luis Lavena on 11 Mar, 2011 06:21 PM
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.
3 Posted by Jeff on 11 Mar, 2011 07:10 PM
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?
Support Staff 4 Posted by Luis Lavena on 11 Mar, 2011 07:19 PM
$ 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
5 Posted by Jeff on 11 Mar, 2011 07:46 PM
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)
and if I try the remove first I get:
gem sources --remove http://gems.rubyforge.org
ERROR: While executing gem ... (Gem::RemoteSourceException)
Support Staff 6 Posted by Eric Hodel on 15 Mar, 2011 11:44 PM
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
7 Posted by Jeff on 16 Mar, 2011 01:09 AM
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)
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)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?
Support Staff 8 Posted by Luis Lavena on 16 Mar, 2011 02:08 AM
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
9 Posted by aleffe on 09 Apr, 2012 07:31 PM
Excellent! I had the exact same problem with MacOSX Tiger. Now gem works. Thanks Luis!
10 Posted by Daniel Canet on 30 Jun, 2012 01:57 PM
Thanks Luis and Jeff!!
You saved my day.
Nick Quaranto closed this discussion on 04 Aug, 2012 02:49 PM.