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


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.

  • thank's @michael-hampton but show the same: ERROR ***: Cannot execute /usr/local/lib/ruby/2.2.0: Permission denied (13) – dcalixto Sep 24 '15 at 1:48
  • Again, that's a directory, not a copy of the ruby program. – Michael Hampton Sep 24 '15 at 1:49
  • but with which ruby show: /usr/local/bin/ruby so, i tried to find and did not find the ruby interpreter on ubuntu – dcalixto Sep 24 '15 at 2:09
  • /usr/local/bin/ruby would be correct, then. – Michael Hampton Sep 24 '15 at 2:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.