简体   繁体   English

Capistrano Deploy失败Bundler :: GemNotFound

[英]Capistrano Deploy fails Bundler::GemNotFound

For some reason my deployment has failed due to being unable to find the will_paginate gem, I haven't had a problem with adding new gems to my app and deploying previously. 由于某种原因,由于无法找到will_paginate gem,我的部署失败了,向我的应用程序添加新的gem并进行先前的部署没有问题。

If you go to My Site you will see the error. 如果您转到“ 我的网站” ,则会看到错误。

I have tried adding 我尝试添加

require "bundler/capistrano"

to my Capfile, but it still fails. 到我的Capfile,但仍然失败。

boot.rb 的boot.rb

require 'rubygems'

# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])

Locally I added the gem, ran bundle and everything works.. 我在本地添加了宝石,运行了捆绑包,一切正常..

Anything I can do to troubleshoot this or has anyone seen this before? 我可以做些什么来解决此问题,或者以前有没有人看过?

Thanks 谢谢

This error seems to be coming whilst loading your app, not during deploy. 加载您的应用程序时而不是在部署期间似乎会出现此错误。

You should have require 'bundler/setup' somewhere in your app config. 您应该在应用程序配置中require 'bundler/setup'某处require 'bundler/setup'

In Rails this would generally be in config/boot.rb . 在Rails中,通常位于config/boot.rb

Bundler's Getting Started might help. Bundler的入门可能会有所帮助。

I have seen similar errors at times. 我有时也看到类似的错误。 This can be because of some dependency problems, which occur often because of gem updations, most of the time. 这可能是由于某些依赖关系问题,这些问题通常在大多数时候是由于宝石更新而发生的。

I think, you better check the will_paginate gem version in your application deployed environment. 我认为,最好在应用程序部署环境中检查will_paginate gem版本。 Then, you might get some clue about the error. 然后,您可能会得到有关该错误的一些线索。 Removing gemset if you are using gemset or removing the existing will_paginate gem and do 'bundle install' should resolve your problem. 如果您正在使用gemset则删除gemset或删除现有的will_paginate gem并执行“捆绑安装”应该可以解决您的问题。

Hope it Helps and let me know, if that does not solve your problem. 希望能对您有所帮助,并让我知道。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM