Nginx passenger rails

dcalixto asked:

On a EC2 with ubuntu 14.04 with nginx/passenger/rails came with this log on nginx:

App 31063 stderr: * ERROR *: Cannot execute /usr/local/lib/ruby:
Permission denied (13)

App 31065 stderr: /etc/profile.d/rbenv.sh: line 3: rbenv: command not
found

nginx conf is:

worker_processes  1;
error_log  logs/error.log;
events {
    worker_connections  1024;
}

http {
    passenger_root /usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.18;
    passenger_ruby /usr/local/lib/ruby;

    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    server {
       listen 80;
        server_name teste.com;
        root /home/ubuntu/teste/current/public;
        passenger_enabled on;
        rails_env production;
        access_log  logs/access.log;


        location ~ ^/(assets)/  {
          gzip_static on;
          expires max;
          add_header Cache-Control public;
        }


       error_page 500 502 503 504 /500.html;
       client_max_body_size 4G;
       keepalive_timeout 10;

            }


}

someone cloud give some light? thank’s

My answer:


You have not set passenger_ruby correctly.

    passenger_ruby /usr/local/lib/ruby;

This is meant to be set to the Ruby binary itself. But you have set it to a directory.

Change it to the location of your ruby interpreter.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.