【问题标题】:Phusion Passenger: There was an error in your Gemfile, and Bundler cannot continuePhusion Passenger:您的 Gemfile 中有错误,Bundler 无法继续
【发布时间】:2013-12-17 23:55:40
【问题描述】:

Passenger 在“正常工作”(如广告中所宣传的那样)时令人惊叹,但如果不正常,则很难弄清楚实际发生了什么。

There was an error in your Gemfile, and Bundler cannot continue. 
/usr/lib/ruby/vendor_ruby/bundler/dsl.rb:12:in `rescue in evaluate'
/usr/lib/ruby/vendor_ruby/bundler/dsl.rb:6:in `evaluate'
/usr/lib/ruby/vendor_ruby/bundler/definition.rb:18:in `build'
/usr/lib/ruby/vendor_ruby/bundler.rb:135:in `definition'
/usr/lib/ruby/vendor_ruby/bundler.rb:123:in `load'
/usr/lib/ruby/vendor_ruby/bundler.rb:107:in `setup'
/usr/lib/ruby/vendor_ruby/bundler/setup.rb:17:in `<top (required)>'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:219:in `block in run_load_path_setup_code'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:333:in `running_bundler'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:217:in `run_load_path_setup_code'
/usr/share/passenger/helper-scripts/rack-preloader.rb:96:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:153:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:28:in `<main>'

修补bundler 源揭示了实际的异常消息:

cannot load such file -- rubygems/format (LoadError) (Bundler::GemfileError)

这也不是很丰富,但至少看起来bundler 是在错误的环境中运行的。在应用程序运行的用户下执行bundle 产生:

Your bundle is complete!
Gems in the groups development and test were not installed.
It was installed into /home/appname/www/shared/bundle

任何指针将不胜感激。谢谢!

【问题讨论】:

  • 你在运行 bundle install 时是否使用了 rvmsudo
  • 不,只是bundle install。宝石真的在捆绑商所说的地方。我不确定为什么会调用 /usr/lib/ruby/vendor_ruby/bundler...
  • 查看这个问题的接受答案的 cmets stackoverflow.com/questions/10574405/… 即使您使用 ruby​​ 2.0 捆绑器可能正在使用 1.8 如果这些 cmets 对您没有帮助,请发布您的 gemfile
  • 好吧,Passenger 只是加载您的应用程序,捕获您的应用程序在启动期间抛出的任何异常,并将其呈现给您。它对问题的实际原因无能为力,因为这超出了乘客的控制范围。至于无法加载 ruby​​gems/format: 可能是权限问题。检查错误页面中的 UID 和环境变量转储。他们是对的吗?

标签: ruby-on-rails bundler passenger


【解决方案1】:

最终从头开始重新安装 rvmpassenger,并且成功了...

【讨论】:

    猜你喜欢
    • 2016-09-30
    • 2013-01-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-19
    • 2015-01-16
    • 1970-01-01
    • 2016-03-14
    相关资源
    最近更新 更多