问题描述
我正在尝试冻结一个特定的 gem(通过我的编辑),以便我可以将修改后的版本推送到 Heroku.根据 本次讨论,我正在使用 bundle package
将我现有 gem 的副本保存到 vendor/cache
中,但仔细检查后发现这捆绑了原始服务器版本gem 的版本,不是我的版本.
I'm trying to freeze a particular gem (with my edits) so I can push the modified version to Heroku. Per this discussion, I'm using bundle package
to save copies of my existing gems into vendor/cache
, but on closer inspection, it turns out this bundles the original server version of the gem, not my version.
我已经验证在 bundle show gdata
中指定的文件包含我的编辑,我认为这会将捆绑器指向该版本.bundle-package doc 声明它只对 .gem 文件进行操作(所以不是安装的 gem 目录?).
I've verified that the files specified in bundle show gdata
include my edits, which I thought would point the bundler to that version. The bundle-package doc states that it only operates on .gem files (so not the installed gem directory?).
如何冻结我的特定版本的 gem?
How can I freeze my particular version of the gem?
推荐答案
将修改后的 gem 复制到像 vendor/gems
这样的文件夹中,然后在 Gemfile 中指向该版本:
Copy your modified gem into a folder like vendor/gems
, and then point to that version in your Gemfile:
gem "modified_gem", :path => "vendor/gems/modified_gem"
并且不要忘记将 vendor/gems
签入版本控制.
And don't forget to check vendor/gems
into version control.
抱歉这个答案太简短,如果您需要澄清,请告诉我.
Sorry for the brevity of this answer, let me know if you need clarification.
这篇关于如何在我编辑的 gem 上使用捆绑包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!