尝试运行 cap deploy:restart 时为 nil 的未定义方法 []

我有一个 Rails 5.2 应用程序,使用上限 3.4.1 我们突然收到这个奇怪的错误:

    [b35efe76]  Phusion Passenger(R) 6.0.8
     DEBUG [b35efe76] Finished in 0.305 seconds with exit status 0 (successful).
    (Backtrace restricted to imported tasks)
    cap aborted!
    SSHKit::Runner::ExecuteError: Exception while executing as deploy@host.com: undefined method `[]' for nil:NilClass

试图缩小范围,它在尝试重新启动时发生,因为这是失败的行:

cap production deploy:restart

问题是,我如何找到试图在 nil 值上调用 [] 的文件?使用 --trace 运行 cap 没有任何价值,因为它只会给我内部错误 - 我的代码中没有任何内容。基本上,我如何找出什么是 nil?

还有一个线索,目前,我有一堆服务器,如果我在服务器 A 上运行 cap restart 命令,它会重新启动,在服务器 B 上,它会抛出这个错误,所以我猜有一个环境变量服务器 A 但不是 B,但错误太不透明了,我不知道从哪里开始。

感谢您的帮助, 凯文

baidu99150 回答:尝试运行 cap deploy:restart 时为 nil 的未定义方法 []

一个疯狂的猜测:我遇到了类似的问题,我可以通过将 capistrano-passenger 升级到 >= 0.2.1 来解决它

Looks like 乘客从 6.0.7 到 6.0.8 的版本变化引入了一个问题。我看到你也在 6.0.8,所以它可能也会影响你!

Link to the capistrano-passenger issue

本文链接:https://www.f2er.com/627011.html

大家都在问