How to use rbenv with a passenger?

I find it difficult to determine how to use rbenvwith passenger. I run debian 6, so I installed passengerfrom the repository oss-binaries.phusionpassenger.com. Then I installed rbenv, ruby-buildand rubyand sinatra. Then I created a test application.

nginx.conf:

server {
    server_name a1;
    root   /home/yuri/a1/public;
    access_log   /var/log/nginx/a1-access.log;
    error_log   /var/log/nginx/a1-error.log;
    passenger_ruby   /home/yuri/.rbenv/shims/ruby;
    passenger_enabled   on;
}

~/a1/config.ru:

require './app'
run Sinatra::Application

~/a1/app.rb:

require 'sinatra'
get '/' do
    "Hello World!"
end

This is what I see in the browser , and in error.log .

+4
source share
1 answer

The solution is to specify the version rubyfor a specific application:

$ cd ~/a1
$ rbenv local 1.9.3-p385
+2
source

All Articles