Gems installed with the --user-install option into the OS X home folder aren't working properly afterwards.

1

On previous OS X revisions i had installed my gems with sudo. With Yosemite i wanted to change that and install without sudo. To leave the default gems in

/Library/Ruby/Gems/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0

and put the ones i want to install into the third folder

 /Users/myuser/.gem/ruby/2.0.0

The three are listed as GEM PATHS returned by the gem environment command. The install worked fine. Afterwards i've added the path variable to my bash_profile:

export PATH=~/bin:/usr/local/bin:/Users/myuser/.gem/ruby/2.0.0/bin:$PATH

i've installed Sass, Compass and a few more other Compass related gems. When i try to run compass watch inside the Terminal i get:

[myuser@localhost][project] compass watch
LoadError on line ["55"] of /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb: cannot load such file -- sassy-math
Run with --trace to see the full backtrace
[myuser@localhost][project]

Same if try to run Compass from within Codekit.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'compass' (>= 0) among 12 total gem(s) (Gem::LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
    from /Users/danton/.gem/ruby/2.0.0/bin/compass:22:in `<main>'

It seems the gems within my userfolder aren't noticed at all. Is there a way to get things going in that setup or do i have to revert to the sudo install? :/

rpk

Posted 2014-12-12T01:22:59.770

Reputation: 125

Have you tried the GEM_PATH environment variable? E.g. GEM_PATH=/Users/myuser/.gem/ruby/2.0.0 compass watch. See this (scroll down a ways or search the page for GEM_PATH)

– hololeap – 2014-12-12T03:56:05.217

hm in my gem environment the paths are already set to: /Library/Ruby/Gems/2.0.0 and /Users/myuser/.gem/ruby/2.0.0 and /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0 . so basically it should work (but is not). and is it possible to set a binary in the gem_path including an option like watch? couldn't find anything related in the linked doc file. – rpk – 2014-12-12T09:33:18.403

No answers