Elastic Beanstalk & Rails - nginx 错误 "undefined local variable or method `location_config_filename' "

Elastic Beanstalk & Rails - nginx error "undefined local variable or method `location_config_filename' "

我正在尝试将我的 Rails 应用程序部署到 eb 容器(ruby 2.5 passenger standalone),但 nginx 错误仍然存​​在。我应该如何解决这个问题?

: Completed activity. Result:
+ service passenger restart
According to the PID file '/var/app/support/pids/passenger.pid',
Phusion Passenger Standalone doesn't seem to be running.

If you know that Phusion Passenger Standalone *is* running then one of these
might be the cause of this error:

* The Phusion Passenger Standalone instance that you want to stop isn't running
on port 80, but on another port. If this is the case then you
should specify the right port with --port.
If the instance is listening on a Unix socket file instead of a TCP port,
then please specify the PID file's filename with --pid-file.
* The instance that you want to stop has stored its PID file in a non-standard
location. In this case please specify the right PID file with --pid-file.
/opt/elasticbeanstalk/support/conf/nginx_config_healthd.erb:49:in `get_binding': undefined local variable or method `location_config_filename' for #<PhusionPassenger::Standalone::StartCommand:0x000056170aa02450> (NameError)
from /opt/rubies/ruby-2.5.0/lib/ruby/2.5.0/erb.rb:885:in `eval'
from /opt/rubies/ruby-2.5.0/lib/ruby/2.5.0/erb.rb:885:in `result'
from /opt/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/passenger-5.2.1/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb:187:in `block in write_nginx_config_file'
from /opt/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/passenger-5.2.1/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb:180:in `open'
from /opt/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/passenger-5.2.1/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb:180:in `write_nginx_config_file'
from /opt/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/passenger-5.2.1/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb:42:in `start_engine_real'
from /opt/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/passenger-5.2.1/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb:323:in `start_engine'
from /opt/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/passenger-5.2.1/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb:63:in `run'
from /opt/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/passenger-5.2.1/src/ruby_supportlib/phusion_passenger/standalone/main.rb:51:in `run!'
from /opt/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/passenger-5.2.1/bin/passenger:45:in `<top (required)>'
from /opt/rubies/ruby-2.5.0/bin/passenger:23:in `load'
from /opt/rubies/ruby-2.5.0/bin/passenger:23:in `<main>'

您是否在 Gemfile 中包含 passenger gem?如果是这样,请确保它仅在 non-production 组中使用。 EB 随 passenger pre-installed 一起提供,因此如果您将其作为应用程序的一部分安装,您将会看到冲突。

根据经验,您可能需要关闭您的实例并重新启动它才能从中恢复...