Ruby on rails 用户的Nginx配置

Ruby on rails 用户的Nginx配置,ruby-on-rails,ruby,nginx,Ruby On Rails,Ruby,Nginx,我正在使用nginx和passenger进行rails部署。 在nginx配置文件中,我想让nginx与用户组“deployers”的用户“deployer”一起运行。因此,我将用户配置更改为 # /opt/nginx/conf/nginx.conf user deployer deployers; worker_processes 2; #error_log logs/error.log; 但是,无论我重新启动服务多少次,它仍然由用户“

我正在使用nginx和passenger进行rails部署。 在nginx配置文件中,我想让nginx与用户组“deployers”的用户“deployer”一起运行。因此,我将用户配置更改为

# /opt/nginx/conf/nginx.conf                       

user  deployer deployers;
worker_processes  2;

#error_log  logs/error.log;
但是,无论我重新启动服务多少次,它仍然由用户“nobody”运行

有人经历过这种情况,并且知道如何告诉nginx使用user deployer运行吗? 因为用户nginx是在nobody下运行的,所以在这个错误页面中会导致gem错误,即没有gem检测到结果

Error page:
It looks like Bundler could not find a gem. Maybe you didn't install all the gems that this application needs. To install your gems, please run:

bundle install
If that didn't work, then maybe the problem is that your gems are installed to //.rvm/gems, while at the same time you set PassengerRuby (Apache) or passenger_ruby (Nginx) to /usr/local/rvm/gems/ruby-2.1.0/wrappers/ruby. Because of the latter, RVM does not load gems from the home directory.

To make RVM load gems from the home directory, you need to set PassengerRuby/passenger_ruby to an RVM wrapper script inside the home directory:

Login as nobody.
Enable RVM mixed mode by running:
rvm user gemsets
Run this to find out what to set PassengerRuby/passenger_ruby to:
/usr/local/rvm/gems/ruby-2.1.0/wrappers/ruby \
/usr/local/rvm/gems/ruby-2.1.0/gems/passenger-4.0.44/bin/passenger-config --detect-ruby
If that didn't help either, then maybe your application is being run under a different environment than it's supposed to. Please check the following:

Is this app supposed to be run as the nobody user?
Is this app being run on the correct Ruby interpreter? Below you will see which Ruby interpreter Phusion Passenger attempted to use.
Please check whether the correct RVM gemset is being used.

nginx.conf
具有全局参数,包括
user
。工作进程在其下运行的用户和组是使用此参数配置的。将其更改为所需的,然后重新启动

nginx.conf
中的用户是什么?对不起,你是说“无人”吗?它附带了默认的nginx.conf这是默认配置#user nobody;工人4#错误日志/error.log#错误日志/error.log通知#错误日志/error.log信息#pid日志/nginx.pid;是的,巴拉,这也是我所理解的,这就是为什么我将它修改为用户部署器;