[英]Nginx/Passenger/Ruby error: Cannot execute ruby. Permission denied
After upgrading Passenger to 1.5.10 on Ubuntu, my rails app won't run. 在Ubuntu上将Passenger升级到1.5.10后,我的rails应用程序将无法运行。 Passenger gives me an error:
乘客给我一个错误:
Cannot execute /root/.rvm/gems/ruby-2.0.0-p451/wrappers/ruby: Permission denied (13)
The ruby executable path is valid, and I can run it from the command line. ruby可执行路径是有效的,我可以从命令行运行它。 The file is owned by root:rvm, and nginx is running as www-data:www-data, so I figured that mismatch was the problem, but even when I change the ruby owner to www-data, I still have the same issue.
该文件归root:rvm所有,并且nginx以www-data:www-data的身份运行,所以我认为不匹配是问题所在,但是即使将ruby所有者更改为www-data,我仍然遇到相同的问题。
As far as I can tell from the Passenger tutorial, everything is set up correctly. 据我从《乘客》教程中了解到的,一切都已正确设置。 From my nginx.conf:
从我的nginx.conf中:
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
passenger_ruby /usr/local/rvm/gems/ruby-2.0.0-p451/wrappers/ruby;
passenger_user www-data;
passenger_group www-data;
And in the site configuration, I set passenger_enabled on
. 在网站配置中,我将设置为
passenger_enabled on
。
So now I'm stumped and would be grateful for assistance. 所以现在我很沮丧,非常感谢您的帮助。
Thanks to Cameron's comment ^, I discovered that I had set passenger_ruby to the wrong path in my nginx server block. 多亏了卡梅隆(Cameron)的评论^,我发现我在nginx服务器块中将passenger_ruby设置为错误的路径。 The ruby executable specified there was under /root and therefore inaccessible to www-data.
在此处指定的ruby可执行文件位于/ root下,因此www-data无法访问。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.