简体   繁体   English

如何使用Bundler在nginx下为Phusion Passenger定义PATH?

[英]How can I define PATH for Phusion Passenger under nginx with Bundler?

Please forgive my near total ignorance of Ruby, but I am having an issue with Phusion Passenger in that it attempts to run something that relies on $PATH (and blindly assumes it is defined and a string). 请原谅我几乎完全不了解Ruby,但是Phusion Passenger遇到了一个问题,因为它试图运行依赖$ PATH的内容(并且盲目地假设它已定义并且是字符串)。 However, nginx evidently clears out the variable. 但是,nginx显然清除了变量。

Error message:
    private method `split' called for nil:NilClass

...

Backtrace:
#   File                                                       Line  Location
0   /usr/lib64/ruby/gems/1.8/gems/bundler-1.1.0/lib/bundler.rb 254   in `which'

That line reads: 该行显示为:

        path = ENV['PATH'].split(File::PATH_SEPARATOR).find do |p|

If there is a workaround for this, I would greatly appreciate it, as I would like to avoid using Apache if at all possible. 如果有解决方法,我将不胜感激,因为我想尽可能避免使用Apache。

have you tried setting the path within your nginx config? 您是否尝试过在Nginx配置中设置路径? Something to the effect: 效果:

env  PATH=/some/path/expected:/another/path;

See: http://wiki.nginx.org/CoreModule#env 请参阅: http//wiki.nginx.org/CoreModule#env

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM