无法使用 Ubuntu 14、nginx 和 passenger 在生产环境中加载 rails 应用程序

Can't get rails app to load in production using Ubuntu 14, nginx, and passenger

我有一个 rails 4 应用程序,它在我的 macbook 上开发时运行良好。
我遵循了关于如何使用部署应用程序的非常详细的教程:

rails 应用程序似乎无法根据 this error here 加载。

...但是我有点迷路了。消息 "No such file to load -- Sequence (LoadError)" 和随后的详细信息似乎并未指明哪个内容未加载。

bundle install

rake db:migrate

...工作正常。

/usr/bin/passenger-config validate-install

...也说一切都很好。

查看 Nginx 错误日志得出了这个摘录,但我不确定它应该把我引向何方:

Could not spawn process for application /var/www/mymri/code: An error occurred while starting up the preloader.

我为 Nginx 启用了友好错误。这会产生很多其他相关信息,其中一些我可能不应该分享。

接下来我应该检查什么来解决这个问题?

编辑 1:

这个SO answer对我不起作用。我已确认乘客 运行 与拥有应用程序代码目录中文件的用户相同。我认为 passenger 正确地找到了 rails 应用程序,但该应用程序无法加载某些依赖项。

我有一个

require 'filename'

...在那个位置。将其注释掉,现在工作正常。不记得为什么我把它放在那里。不知道为什么它在开发中有效,但在生产中无效。有时,我会查看 rails 错误消息中冗长的堆栈转储,想知道下一步该去哪里。我想这种反复试验是老师。此处的提示位于错误堆栈转储中第 49 行的第 7 行,其中显示

/var/www/mymri/code/app/controllers/institutions_controller.rb:2:in '< class:InstitutionsController >'

感谢https://whosebug.com/users/1153362/substantial