首页 > 解决方案 > Why is passenger with Nginx looking for passenger_wsgi.py in my rails app

问题描述

My conf file looks like

root /var/www/root/public;

    # Turn on Passenger
    passenger_enabled on;
    passenger_ruby /usr/local/rvm/gems/ruby-2.5.1/wrappers/ruby;

and whenever I curl to the site the error I see in Nginx logs is

Cannot stat '/var/www/root/passenger_wsgi.py': Permission denied (errno=13); This error means that the Nginx worker process (PID 4417, running as UID 33) does not have permission to access this file.

But this is a rails app and I do not have python.

The passenger gem is installed and the app is deployed in production mode.

Why is it looking for a python file and how do I fix this error?

This is on Linode if it helps and I am using rvm.

标签: ruby-on-railsnginxruby-on-rails-5passenger

解决方案


根据帖子中提到的描述,您似乎没有为 ruby​​ 应用程序正确安装乘客。

在安装乘客期间,您可以选择要针对哪种语言安装(节点、python、ruby 等)。

现在根据共享的日志,它似乎正在充当 python 应用程序的应用服务器。

我遇到了同样的问题,我发现完成这项工作的唯一方法是卸载乘客并再次安装(选择 ruby​​ 作为 )。


推荐阅读