如何防止捆绑程序将平台信息添加到Gemfile.lock [英] how to prevent bundler from adding platform info to Gemfile.lock

查看:74
本文介绍了如何防止捆绑程序将平台信息添加到Gemfile.lock的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次运行 bundle --without = production 捆绑程序都会添加平台信息平台格式
x86-mingw32
Gemfile.lock ,在部署到Heroku时,我必须手动删除该信息。如果我不删除它,则 Gemfile.lock 不会添加到存储库中并导致错误。

every time I run bundle --without=production bundler adds platform information PLATFORMS x86-mingw32 to Gemfile.lock and I have to remove that info manually as I am deploying to Heroku. If I do not remove it, Gemfile.lock is not added to repository and causes errors.

我该如何防止捆绑程序将平台信息添加到 Gemfile.lock

how can I prevent bundler from adding platform info to Gemfile.lock

推荐答案

一个非常相似的问题-我可以阻止邦德勒将RUBY VERSION添加到Gemfile.lock 中吗?事实证明,答案是这是不可能的。 Bundler在内添加此信息。 to_lock 方法,并且没有条件跳过该部分。

I had a very similar question - Can I stop Bundler from adding RUBY VERSION to Gemfile.lock - and it turns out the answer is that it can't be done. Bundler adds this information within the to_lock method and there's no conditional to skip that section.

似乎可以重构 to_lock 来控制实际写入锁文件的哪些部分,但是到目前为止,这还不足以让我做出努力。

It seems like it would be possible to refactor to_lock to control which sections of the lockfile are actually written, but so far this hasn't been enough of a pain point for me to make that effort yet.

这篇关于如何防止捆绑程序将平台信息添加到Gemfile.lock的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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