tags:

views:

1243

answers:

1
> gem env gempath
/Users/davec/.gem/ruby/1.8:/opt/local/lib/ruby/gems/1.8

> head Rakefile
require 'rubygems'
puts Gem.path
require 'rake/clean'
require 'rake/testtask'
require 'rcov'
require 'rcov/rcovtask'

> rake
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
/Library/Ruby/Gems/1.8
rake aborted!
no such file to load -- rcov
/Users/davec/Projects/matrix/rakefile:5
(See full trace by running task with --trace)

If I go into irb, or create a .rb script, I can require gems that I've installed.

I have the latest rubygems-update, rake, and rcov.

Anyone seen this before? It seems like something is amiss and I'd like to avoid setting GEM_PATH or hacking /etc/gemrc (which doesn't exist at the moment)

+1  A: 

/opt/local/lib is generally the path configured by macports. Did you install RubyGems via macports?

Also ensure which gem doesn't return the /opt/local path.

If so, I would suggest to remove any macports ruby package and install RubyGems from source. Also, Leopard should come with RubyGems installed (AFAIK).

Simone Carletti
I must've done that; where does OS X put the gem command?
davetron5000
I've got mine in /usr/bin/gem, that is a symbolic link to /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem
Simone Carletti
uninstall gem from port and re-symlinked the above path to `/usr/bin/gem` and all is good.
davetron5000