Bundler:更改Gemfile后,您尝试以部署模式安装 [英] Bundler: You are trying to install in deployment mode after changing your Gemfile

查看:248
本文介绍了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:


您正在尝试在更改Gemfile之后以部署模式进行安装。在其他地方运行捆绑安装并将更新的Gemfile.lock添加到版本控制中。

You are trying to install in deployment mode after changing your Gemfile. Run `bundle install' elsewhere and add the updated Gemfile.lock to version control.

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

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.lock,并且您已经更新了Gemfile(5),则
捆绑程序将使用Gemfile.lock用于未更新的所有gems
,但将重新解析您已更新的gems
的依赖关系。您可以在下面的保守更新中找到有关此更新
流程的更多信息。

If a Gemfile.lock does exist, and you have updated your Gemfile(5), bundler will use the dependencies in the Gemfile.lock for all gems that you did not update, but will re-resolve the dependencies of gems that you did update. You can find more information about this update process below under CONSERVATIVE UPDATING.

我的意思是说捆绑器可以处理我的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提供一个:platform 标志应该解决不对称性。

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后,您尝试以部署模式安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆