我为在 nginx 上运行的 rails 应用程序设置了一个 OSX 网络服务器。当我手动启动服务器时,rails 应用程序工作正常,但是当我重新启动服务器时,我总是收到乘客错误消息
没有要加载的文件--bundler
我想这与我手动设置的启动守护进程有关:
# /Library/LaunchDaemons/org.nginx.ngnx.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>nginx</string>
<key>UserName</key>
<string>MyUser</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/Cellar/nginx/1.0.11/sbin/nginx</string>
<string>-g</string>
<string>daemon off;</string>
</array>
<key>KeepAlive</key>
<true/>
<key>NetworkState</key>
<true/>
<key>LaunchOnlyOnce</key>
<true/>
</dict>
</plist>
如您所见,我MyUser
在 plist 中用作 UserName。nginx 服务器在启动后启动并以 MyUser 身份运行,但我收到此错误消息。
当我在命令行上重新启动它时,sudo nginx -s stop && nginx
一切正常。
任何想法为什么?
编辑
我的 nginx.conf 看起来像这样:
env GEM_HOME=/usr/local/rvm/gems/ruby-1.9.2-p290@rails311/gems;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 60 60;
send_timeout 120;
recursive_error_pages on;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
gzip on;
gzip_http_version 1.1;
gzip_comp_level 4;
gzip_proxied any;
gzip_vary on;
gzip_min_length 1100;
gzip_buffers 32 16k;
#server_tokens off;
tcp_nopush on;
tcp_nodelay on;
keepalive_requests 0;
passenger_default_user eveadmin;
passenger_default_group staff;
passenger_root /usr/local/rvm/gems/ruby-1.9.2-p290@rails311/gems/passenger-3.0.12;
passenger_ruby /usr/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby;
server {
listen 8444;
#server_name intranet.local;
root /Users/eveadmin/rails/intranet/public;
passenger_enabled on;
rails_env development;
}
}