7

I've been trying to install passenger with no success yet.

I've installed the gem, but when I run

passenger-install-apache2-module

it tells me

This installer must be able to write to the following directory:
/Users/myname/.rvm/gems/ruby-1.9.2-p0/gems/passenger-3.0.0
But it can't do that, because you're running the installer as myname.
Please re-run this installer as root.

but if I do

sudo passenger-install-apache2-module

I get

/Users/myname/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems.rb:762:in `report_activate_error': Could not find RubyGem passenger (>= 0) (Gem::LoadError)

from /Users/myname/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems.rb:219:in activate' from /Users/myname/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems.rb:1065:ingem' from /Users/myname/.rvm/gems/ruby-1.9.2-p0/bin/passenger-install-apache2-module:18:in `'

I've tried to look at those files, but cannot understand what's wrong.

can you please help?

thanks, P

3
  • what right has your directory /Users/myname/.rvm/gems/ruby-1.9.2-p0/gems/ ?
    – shingara
    Nov 12, 2010 at 18:17
  • I assume the second command you ran was "sudo passenger-install-apache2-module," not "passenger-install-apache2-module" again, right?
    – bnaul
    Nov 12, 2010 at 18:17
  • Shingara: drwxr-xr-x // bnaul: you're right. corrected :)
    – Pierre
    Nov 12, 2010 at 18:33

3 Answers 3

32

Two solutions:

  1. Use rvmsudo, not sudo.
  2. Fix your directory permissions. /Users/myname/.rvm should be writable for myname but for some reason you caused that not to be the case.
3
  • rvmsudo worked for me also having the exact same error trying to get passenger-install-nginx-module working thanks for this! Jan 20, 2011 at 6:28
  • Wow, rvmsudo, they have thought of everything!
    – Amala
    Apr 16, 2011 at 2:21
  • I just ran into this same problem and rvmsudo made it work for me. Thanks!
    – sclarson
    Jul 7, 2011 at 1:49
0

I think you can use system ruby instead of RVM ruby for installing passenger:

rvm use default
sudo gem install passenger
sudo passenger-install-apache2-module
0
0

I actually chmod the folder as Shingara suggested and it worked.

the only thing I can't understand is why issuing the command with sudo lead to problems :(

thanks for your help!

1
  • 1
    Because you're not supposed to use sudo when running anything that involves RVM. Always use rvmsudo instead.
    – Hongli
    Dec 27, 2010 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.