2

Where's the mismatch between gem install path and used Rakefile path?

I originally wanted to run a Rakefile on my Mac OS X Mountain Lion 10.8.4. That failed on a missing 'open4' package.

I have no experience with ruby and little with Mac, but I googled open4 and found:

gem install open4

That also failed, but with sudo it succeeded.

It still didn't work though and my conclusion is that the install path:

/Library/Ruby/Gems/1.8

is different from the runtime include path, which I dumped from the script:

/Library/Ruby/Site/1.8
/Library/Ruby/Site/1.8/powerpc-darwin12.0
/Library/Ruby/Site/1.8/universal-darwin12.0
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/1.8
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/1.8/universal-darwin12.0
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/powerpc-darwin12.0
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0

More googling led me to stackoverflow understanding-rubys-load-paths and more. They all seem to conclude the solution is RVM (links to RVM were broken)

I installed that:

sudo curl -L https://get.rvm.io | bash

But the path used by RVM was no better:

$ rvm gemdir
/Library/Ruby/Gems/1.8

A very old question - gem-path-used-by-rake-different-than-system-path-on-os-x seems to cover what I want to know, but the solution doesn't seem relevant on current OSX

Where's the mismatch between install and used path?

Community
  • 1
  • 1
Holger Bille
  • 2,421
  • 1
  • 16
  • 20

1 Answers1

3

you need to use an rvm ruby:

rvm use ruby --install --default
mpapis
  • 52,729
  • 14
  • 121
  • 158
  • Thx. That did the trick, together with 'rvm all do gem install open4'. I still don't get why the cumbersome package + version management is necessary, but then I may not need to know. Thanks again :-) – Holger Bille Jun 28 '13 at 22:40
  • after `use` it should be enough to `gem install open4` doing it for `all` is not the proper way. – mpapis Jun 28 '13 at 23:14