Installing Rubygems manually -'ruby setup.rb' fails PLEASE HELP!

Andrew's Avatar

Andrew

05 Jul, 2011 11:22 PM

Hello

After having tried the various methods such as:

$ gem update --system $ gem install rubygems-update

and getting:

ERROR: While executing gem ... (Gem::RemoteSourceException)

HTTP Response 302

I read here that I need to update rubygems, so tried to do it manually. But when I download and run
ruby setup.rb
I get:

./lib/rubygems.rb:334: warning: parenthesize argument(s) for future version ./lib/rubygems.rb:511: warning: parenthesize argument(s) for future version ./lib/rubygems/dependency_list.rb:8:in `require': ./lib/rubygems/deprecate.rb:53: syntax error, unexpected ',', expecting '|' (SyntaxError)

  define_method name do |*args, &block| # TODO: really works on 1.8.7?
                               ^

./lib/rubygems/deprecate.rb:54: syntax error, unexpected tCONSTANT, expecting '}' ./lib/rubygems/deprecate.rb:63: syntax error, unexpected kEND, expecting '}' ./lib/rubygems/deprecate.rb:68: syntax error, unexpected kEND, expecting '}' from ./lib/rubygems/dependency_list.rb:8

from ./lib/rubygems.rb:29:in `require'
from ./lib/rubygems.rb:29
from setup.rb:27:in `require'
from setup.rb:27

and no go with rubygems.

I have tried removing rubygems by this method: http://lists.rubyonrails.org/pipermail/rails/2006-May/038251.html

but still no go, and now I have no rubygems at all.

I have recently upgraded to Snow Leopard and apparently am running ruby v.1.8.6

Any ideas???

  1. Support Staff 2 Posted by Eric Hodel on 05 Jul, 2011 11:32 PM

    Eric Hodel's Avatar

    RubyGems 1.4 and newer only run on Ruby 1.8.7.

    Snow Leopard ships with Ruby 1.8.7.

    You will either need to:

    Use Ruby 1.8.7 (or newer) from Snow Leopard

    Build Ruby 1.8.7 (or newer) and install RubyGems on it

    Download RubyGems 1.3.7 from Rubyforge:

    http://rubyforge.org/frs/?group_id=126
    
  2. 3 Posted by Andrew on 06 Jul, 2011 01:14 AM

    Andrew's Avatar

    Thanks I have done the above using Macports and have it working now - I thought when I upgraded to Snow Leopard it would have given me the appropriate Ruby versions but it seems not to have done - and kept my older version of Ruby 1.8.6 - does 1.8.7 only come with a clean install of Snow Leopard??

  3. Support Staff 4 Posted by Eric Hodel on 06 Jul, 2011 01:51 AM

    Eric Hodel's Avatar

    Apple's ruby ships in /usr/bin.

    If you've adjusted your path before upgrading to Snow Leopard you may have been using a ruby from /usr/local/bin or /opt/local/bin. The upgrade won't undo changes you've made to your $PATH.

    You can use gem env to see where ruby lives.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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