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 1 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. 2 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 3 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.

  4. 4 Posted by Prajakta on 10 Nov, 2015 09:59 PM

    Prajakta's Avatar

    I see the same error,

    /home/user/rubygems-2.0.7/lib/rubygems/deprecate.rb:53: syntax error (SyntaxError)
          define_method name do |*args, &block| # TODO: really works on 1.8.7?

    I am using ruby 2.0.0. Please help.

  5. 5 Posted by Prajakta on 10 Nov, 2015 10:52 PM

    Prajakta's Avatar

    Never mind. It was an issue with my path.

  6. David Radcliffe closed this discussion on 11 Nov, 2015 01:37 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

Recent Discussions

21 Jul, 2016 11:06 AM
08 Jul, 2016 09:18 PM
05 Jul, 2016 10:21 PM
24 Jun, 2016 02:54 AM
16 Jun, 2016 01:10 AM