Nginx 客運鐵路

Nginx 客運鐵路

在有 nginx/passenger/rails 的 ubuntu 14.04 的 EC2 上,nginx 上有以下日誌:

應用程式 31063 標準錯誤:* 錯誤 *: 無法執行 /usr/local/lib/ruby: 權限被拒絕 (13)

應用程式 31065 stderr:/etc/profile.d/rbenv.sh:第 3 行:rbenv:找不到命令

nginx 設定是:

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;

            }


}

有人雲提供一些光明嗎?謝謝

答案1

你沒有設定passenger_ruby正確。

    passenger_ruby /usr/local/lib/ruby;

這意味著要設定為 Ruby 二進位檔案本身。但你已經把它設定到一個目錄了。

將其更改為您的口譯員所在的位置ruby

相關內容