【问题标题】:Rails on Nginx + Phusion Passenger: "It looks like Bundler could not find a gem. Maybe you didn't install all the gems that this application needs."Rails on Nginx + Phusion Passenger:“看起来 Bundler 找不到 gem。也许你没有安装这个应用程序需要的所有 gem。”
【发布时间】:2016-05-11 20:48:18
【问题描述】:

我有一个使用 Nginx 和 Phusion Passenger 运行的 Rails 应用程序。几个月以来一切正常,但在上次部署后,我收到一个错误“我们很抱歉,但出了点问题。”。

Nginx 日志告诉我们:

[ 2016-05-11 13:28:26.5617 17187/7ff504072700 App/Implementation.cpp:303 ]: Could not spawn process for application /home/a4aa2/rails/current: An error occured while starting up the preloader.
  Error ID: 4153f320
  Error details saved to: /tmp/passenger-error-VPT6E4.html
  Message from application: <p>It looks like Bundler could not find a gem. Maybe you didn't install all the gems that this application needs. To install your gems, please run:</p>

  <pre class="commands">bundle install</pre>

<p>If that didn't work, then the problem is probably caused by your application being run under a different environment than it's supposed to. Please check the following:</p>

<ol>
  <li>Is this app supposed to be run as the <code>a4aa2</code> user?</li>
  <li>Is this app being run on the correct Ruby interpreter? Below you will
      see which Ruby interpreter Phusion Passenger attempted to use.</li>
</ol>

<p>-------- The exception is as follows: -------</p>
Could not find mime-types-2.99.1 in any of the sources (Bundler::GemNotFound)
...etc...

我的宝石似乎全部可用:

[a4aa2@bellatrix ~]$ cd rails/current/
[a4aa2@bellatrix current]$ bundle
Using rake 10.5.0
Using i18n 0.7.0
Using json 1.8.3
...etc...
Bundle complete! 91 Gemfile dependencies, 113 gems now installed.
Gems in the groups development and test were not installed.
Bundled gems are installed into ./vendor/bundle.

我不知道如何调试它。我唯一能想到的就是重新安装 phusion Passenger 并重试。

我正在使用托管服务。是否有可能有另一个 Nginx 进程/安装正在运行,而之前没有运行,现在这两者之间的事情搞砸了?

【问题讨论】:

  • 你的ruby版本好像变了..换个ruby版本试试
  • $ ruby -v 给了我ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]。我有一个.ruby-version 文件,我可以在其中切换 ruby​​,但我应该切换到哪个文件?乘客跑哪一个?这怎么可能改变?

标签: ruby-on-rails nginx passenger


【解决方案1】:

尝试捆绑更新:

bundle update

【讨论】:

  • 请不要。这是个坏建议。你永远不想在没有特定参数的情况下运行bundle update。所以bundle update &lt;problematic_gem_name&gt; 可能,但即便如此我也不认为这是解决手头问题的方法。
猜你喜欢
  • 2017-05-07
  • 1970-01-01
  • 1970-01-01
  • 2014-03-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-05-02
  • 2020-02-03
相关资源
最近更新 更多