我可以阻止Bundler将RUBY VERSION添加到Gemfile.lock中吗 [英] Can I stop Bundler from adding RUBY VERSION to Gemfile.lock

查看:71
本文介绍了我可以阻止Bundler将RUBY VERSION添加到Gemfile.lock中吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我在命令行上运行任何gem命令时,Bundler都坚持要触摸我的 Gemfile.lock 文件以添加以下行:

Every time I run any gem command on the command line, Bundler insists on touching my Gemfile.lock file to add this line:

RUBY VERSION
   ruby 2.2.2p95

我不想将其提交到我们的存储库中,因为这意味着每个使用不同补丁程序级别的Ruby 2.2.2的开发人员都将与我展开战斗。 (我已经因 BUNDLED_WITH 这一行而辞职了类似的问题。)但是除非我 do 提交该行,否则我将无法部署,因为我们的部署是通过rake任务运行的,并且运行该部署会导致Bundler添加此块,所以部署过程会说:等等!您的工作树很脏!您可能正在部署不完整的更改! (嗯,不是字面上的意思,但是您明白了。)

I don't want to commit this to our repository, because it means every dev using a different patch level of Ruby 2.2.2 is going to be in a commit war with me. (I've already resigned myself to a similar issue with the BUNDLED_WITH line.) But I can't deploy unless I do commit that line, because our deploy runs via a rake task and running the deploy leads Bundler to add this block, whereupon the deploy process says, "WAIT! Your working tree is dirty! You might be deploying incomplete changes!!!!1!" (Well, not literally, but you get the idea.)

我可以告诉邦德勒放弃 RUBY VERSION Gemfile.lock 中的c $ c>(最好是 BUNDLED_WITH ),因此我们不必

Can I tell Bundler to leave the RUBY VERSION (and, ideally, BUNDLED_WITH) out of the Gemfile.lock so we don't have to do this ridiculous dance?

如何防止捆绑程序将平台信息添加到Gemfile.lock 似乎是同一个问题,但是没有答案,natch。)

(how to prevent bundler from adding platform info to Gemfile.lock seems to be the same question, but there's no answer, natch.)

推荐答案

我不这么认为,但是也许还可以:

从2.1.0版开始, Ruby不再具有多个补丁版本发布。请参见>版本号如何适用于MRI Ruby?

As of 2.1.0, Ruby no longer has multiple patch level releases for a given version. See accepted answer on How do version numbers work for MRI Ruby?

2.2.2p95是将发布的唯一2.2.2补丁程序级别。 p95仅表示自2.2.0起已有95次提交。

2.2.2p95 is the only patch level of 2.2.2 that will ever be released. 'p95' just means that there have been 95 commits since 2.2.0.

由于您的整个团队无论如何都将处于2.2.2状态,因此将其保留在Gemfile.lock中不会造成任何问题。 (只要每个人都将Bundler更新为执行此操作的版本。否则,在添加和删除红宝石版本时仍然会有冲突。)

Since your whole team will be on 2.2.2 anyway, it shouldn't cause problems to leave this in your Gemfile.lock. (As long as everyone updates Bundler to the version that does this, anyway. Otherwise there'll still be conflicts as the ruby version is added and removed.)

这篇关于我可以阻止Bundler将RUBY VERSION添加到Gemfile.lock中吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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