Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install passenger 3 on Snow Leopard (with RVM and ruby 1.9.2)

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

like image 527
Pierre Avatar asked Nov 12 '10 18:11

Pierre


1 Answers

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.
like image 168
Hongli Avatar answered Sep 24 '22 09:09

Hongli