Installing Passenger in MacOS X using Brew and RVM

#Install RVM    
bash <<( curl )

#Install ruby 1.9.2
rvm install 1.9.2

# Set as default
rvm --default 1.9.2 

# Install passenger in the global gemset
rvm @global gem install passenger       

# Install Nginx                                  
brew install nginx --with-passenger

cp /usr/local/Cellar/nginx/0.8.54/org.nginx.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/org.nginx.plist        

# Decompress the source of Nginx.
cd $HOME/Library/Caches/Homebrew
tar xvf nginx-0.8.54.tar.gz                       

# Now install the nginx module

# Chose to configure to customise your own Nginx installation

# The source code for nginx is here:

# Chose to install nginx to:

# Click intro in the next two questions.

# At the end of the install it says that it modified nginx config file. I don't use that file. I Edit /usr/local/etc/nginx/nginx.conf and add the snippet that the passenger install outputed.

http {
  passenger_root /Users/Nerian/.rvm/gems/ruby-1.9.2-p180@global/gems/passenger-3.0.3;
  passenger_ruby /Users/Nerian/.rvm/wrappers/ruby-1.9.2-p180/ruby;

# Install rails

rvm gem install rails

Configure a Rails 3 Project

# .rvmrc

if [[ -s "/Users/Nerian/.rvm/environments/ruby-1.9.2-p180@DaVinci" ]] ; then
  . "/Users/Nerian/.rvm/environments/ruby-1.9.2-p180@DaVinci"
  rvm --create use  "ruby-1.9.2-p180@DaVinci"

# Set up load path in your Rails 3 project. This is config/setup_load_paths.rb

if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
    rvm_path     = File.dirname(File.dirname(ENV['MY_RUBY_HOME']))
    rvm_lib_path = File.join(rvm_path, 'lib')
    $LOAD_PATH.unshift rvm_lib_path
    require 'rvm'
    RVM.use_from_path! File.dirname(File.dirname(__FILE__))
  rescue LoadError
    # RVM is unavailable at this point.
    raise "RVM ruby lib is currently unavailable."


http {
    include       mime.types;
    default_type  application/octet-stream;
    access_log /tmp/nginx-access.log;

    passenger_root /Users/Nerian/.rvm/gems/ruby-1.9.2-p180@global/gems/passenger-3.0.3;
    passenger_ruby /Users/Nerian/.rvm/wrappers/ruby-1.9.2-p180/ruby;

    sendfile        on;
    keepalive_timeout  65;

#gzip  on;         

server {
      listen 8081;
      root /Users/Nerian/NetBeansProjects/DaVinci/public;
      passenger_enabled on;
      rails_env development;   


source ''

gem 'rails', '3.0.4'                                                     
gem "mongoid", "2.0.0.rc.7"
gem "bson_ext", "~> 1.2"
gem 'launchy'

group :development, :test do
  gem 'rspec-rails'
  gem 'machinist_mongo', :require => 'machinist/mongoid', :git => '', :branch => 'machinist2'
  gem 'steak'
  gem 'capybara'
  gem 'spork', '~> 0.9.0.rc'
  gem "fuubar"  

/etc/hosts is configured:

And I get this error: (at machinist2) is not checked out. Please run bundle install

That gem is installed in the gemset DaVinci. I did run bundle install. It is installed, but passenger doesn’t find it. If I remove that gem, then I get the same errors but with another gem. And so on and so on. So Passenger is not finding the gemset. I can run the project with rails s.

I already spend like 4 hours and I don’t find the F###### error. Do you see something wrong?


Solved with rvm get head. It seems there was a bug or something that wasn’t saving the gemset ‘trusted’ status.

Source : Link , Question Author : Nerian , Answer Author : Nerian

Leave a Comment