简体   繁体   中英

Nginx passenger rails Permission denied

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

Execute in Terminal

sudo chmod o+x "/root"

Resolve this problem!

* ERROR * : Cannot execute /root/.rbenv/versions/2.2.3/bin/ruby Phusion Passenger Permission denied (13) Phusion Passenger nginx centos

http://oki2a24.com/2014/02/08/try-to-install-ruby-and-redmine/

passenger_ruby should point to the ruby command itself. Yours appears to point to a directory /usr/local/lib/ruby/ (based partly on the passenger_root path).

https://www.phusionpassenger.com/library/config/nginx/reference/#passenger_ruby

Try changing passenger_ruby to /usr/bin/ruby , or whatever your path is. "which ruby" would give you the path, if it's in your PATH environment variable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM