I have the following project structure which I can’t get to work:
- Mac OS X Lion with Apache
- PHP 5.3.6 and Symfony 2.0.6 running on this
- RVM with Ruby 1.9.2 and the compass 0.11.5 gem installed
On the command line I am able to run compass; but Symfony and sudo -u _www compass only get the following error message:
/Users/jan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find compass (>= 0) amongst [minitest-1.6.0, rake-0.8.7, rdoc-2.5.8] (Gem::LoadError)
from /Users/jan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /Users/jan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1210:in `gem'
from /Users/jan/.rvm/gems/ruby-1.9.2-p290/bin/compass:18:in `<main>'
When I switch to the user _www (sudo -su _www) and run rvm current, I get system.
By switching to rvm use 1.9.2, I can run compass from the command line (as _www), but as soon as I close the Terminal, _www forgets that it should use Ruby 1.9.2 – rvm use --default 1.9.2 does not work, either.
How can I set Ruby 1.9.2 for _www permanently (or get compass to work with _www another way)?
Try switching to
rvm systemand install the compass gem; this way you don’t have to force _www to use Ruby 1.9.2.