使用Phusion Passenger进行Rails部署:启动预加载器时出错。找不到rake-10.3.2

时间:2014-06-17 09:47:05

标签: ruby-on-rails passenger

错误日志

[ 2014-06-17 17:38:57.4484 15500/7f214dcca700 Pool2/Implementation.cpp:883 ]: Could not spawn process for group /var/www/wherami.com/current#default: An error occured while starting up the preloader.
     in 'void Passenger::ApplicationPool2::SmartSpawner::handleErrorResponse(Passenger::ApplicationPool2::SmartSpawner::StartupDetails&)' (SmartSpawner.h:451)
     in 'std::string Passenger::ApplicationPool2::SmartSpawner::negotiatePreloaderStartup(Passenger::ApplicationPool2::SmartSpawner::StartupDetails&)' (SmartSpawner.h:562)
     in 'void Passenger::ApplicationPool2::SmartSpawner::startPreloader()' (SmartSpawner.h:202)
     in 'virtual Passenger::ApplicationPool2::ProcessPtr Passenger::ApplicationPool2::SmartSpawner::spawn(const Passenger::ApplicationPool2::Options&)' (SmartSpawner.h:746)
     in 'void Passenger::ApplicationPool2::Group::spawnThreadRealMain(const SpawnerPtr&, const Passenger::ApplicationPool2::Options&, unsigned int)' (Implementation.cpp:804)

<p>-------- The exception is as follows: -------</p>
Could not find rake-10.3.2 in any of the sources (Bundler::GemNotFound)
<pre>  /home/rails/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.6.3/lib/bundler/spec_set.rb:92:in `block in materialize&#39;
  /home/rails/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.6.3/lib/bundler/spec_set.rb:85:in `map!&#39;
  /home/rails/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.6.3/lib/bundler/spec_set.rb:85:in `materialize&#39;
  /home/rails/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.6.3/lib/bundler/definition.rb:133:in `specs&#39;
  /home/rails/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.6.3/lib/bundler/definition.rb:178:in `specs_for&#39;
  /home/rails/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.6.3/lib/bundler/definition.rb:167:in `requested_specs&#39;
  /home/rails/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.6.3/lib/bundler/environment.rb:18:in `requested_specs&#39;
  /home/rails/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.6.3/lib/bundler/runtime.rb:13:in `setup&#39;
  /home/rails/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.6.3/lib/bundler.rb:120:in `setup&#39;
  /home/rails/.rvm/gems/ruby-2.0.0-p481/gems/bundler-1.6.3/lib/bundler/setup.rb:17:in `&lt;top (required)&gt;&#39;

我已按照phusion passenger wiki上的指南重置gemset,但问题仍然存在。

1 个答案:

答案 0 :(得分:1)

同样涉及这个问题 - 使用/usr/bin/env ruby从nginx中生成的进程使用了​​错误的Ruby版本,因为PATH缺少其父目录。

/etc/init.d/nginx添加正确的位置为我解决了这个问题。