views:

278

answers:

4

RubyGems newbie here, trying to install the 'less' gem. I type 'sudo gem install less' as instructed at http://lesscss.org/, and I get the following error:

ERROR:  While executing gem ... (Gem::GemNotFoundException)
    Could not find less (> 0) in any repository

Alright, so I figure maybe I just need to update RubyGems. Trying 'gem update --system' gets me

Updating RubyGems...
Attempting remote update of rubygems-update
ERROR:  While executing gem ... (Gem::InstallError)
    rubygems-update requires builder >= 0

Arrgh. Alright, then let's try 'sudo gem install builder':

ERROR:  While executing gem ... (Gem::GemNotFoundException)
    Could not find builder (> 0) in any repository

Seems that no matter what gem I try to install, it can't be found in any repository. I check my environment, and rubyforge is listed:

RubyGems Environment:
  - VERSION: 0.9.4 (0.9.4)
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
  - GEM PATH:
     - /usr/local/lib/ruby/gems/1.8
  - REMOTE SOURCES:
     - http://gems.rubyforge.org

Any idea what's going on? I'm on OSX 10.4, and I installed Ruby 1.8.6 before this.

A: 

The version of rubygems bundled in osx uses gemforge as its offical source of gems - this has since been replaced with gemcutter. You should be able to do

sudo gem update --system

To upgrade to update the latest version of ruby gems, which will then use gemcutter as the sources link

timmow
A: 

That's a really old version of rubygems! How did you install this?

Is it a manual install? If so, perhaps you could try a manual upgrade the same way.

Shtééf
A: 

Do the following:

sudo gem update --system

to update your install of RubyGems. Then, add the Github gem repository to your sources. I suggest github because you'll find a lot of useful things there:

sudo gem sources -a http://gems.github.com
Mike Trpcic
github has stated that their gem hosting will end at the end of this year, so I wouldn't count on that forever. presently gemcutter.org/rubygems.org is the official repo of gems.
Jed Schneider
+1  A: 

I think rubygems 1.3.x requires ruby 1.8.7 so you might install that first. Then update rubygems to 1.3.7. via gem update --system

Jed Schneider