本文介绍了Bundler:更改Gemfile后,您尝试以部署模式安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对捆扎机和capistrano还是很陌生,我正在尝试将它们一起使用。当我尝试进行部署时,收到以下消息:

I'm pretty new to bundler and capistrano, and I'm trying to use them together. When I try to deploy, I get the message:

我不知道如何满足系统要求那是在抱怨,而且我不明白为什么要抱怨,因为我读了:

I don't know how to satisfy the system that's complaining, and I don't understand why the complaint is coming up because I read in the doc:

我的意思是说捆绑器可以处理我的Gemfile与预期不符的事实。有帮助吗?

I interpret that to mean that the Bundler can handle the fact that my Gemfile is not whatever it expected. Any help?

规格:Ruby 1.9.3,Rails 3.2.3,Capistrano 2.12.0,Bundler 1.1.4,Windows 7,部署到Posix

编辑:我的Gemfile包含如下逻辑块:

My Gemfile includes logic blocks like the following:

unless RbConfig::CONFIG['host_os'] === 'mingw32'
  # gem 'a' ...
end


推荐答案

关于 Gemfile的错误消息.lock 可能是因为您的 Gemfile Gemfile.lock 彼此不同其他。自上次运行捆绑安装(或 update )以来,您似乎已经更改了Gemfile中的某些内容。当您捆绑安装时,它将使用您对Gemfile所做的任何更改来更新Gemfile.lock。

The error message you're getting regarding Gemfile.lock may be because your Gemfile and Gemfile.lock don't agree with each other. It sounds like you've changed something in your Gemfile since you last ran bundle install (or update). When you bundle install, it updates your Gemfile.lock with any changes you've made to Gemfile.

进行确保您在本地运行捆绑安装,然后签入源代码控制最新更新的 Gemfile.lock 。然后尝试部署。

Make sure you run bundle install locally, and check-in to source control your newly updated Gemfile.lock after that. Then try deploying.

编辑:正如注释中所承认的那样,有条件的Gemfile在一个平台上产生了有效的Gemfile.lock,对另一个无效。在Gemfile中为这些与平台相关的gem提供一个标志应该解决不对称性。

Edit: As recognised in the comments, a conditional in the Gemfile resulted in a valid Gemfile.lock on one platform, invalid on another. Providing a :platform flag for these platform-dependent gems in the Gemfile should solve the asymmetry.

这篇关于Bundler:更改Gemfile后,您尝试以部署模式安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 12:04