[英]How to use bundle package on my edited gem?
I'm trying to freeze a particular gem (with my edits) so I can push the modified version to Heroku. 我试图冻结一个特定的宝石(并进行编辑),以便将修改后的版本推送到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 package
将我现有的gem的副本保存到vendor/cache
,但是仔细检查后,结果发现捆绑了原来的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. 我已经验证了bundle show gdata
指定的文件包括我的编辑,我认为这会将捆绑器指向该版本。 The bundle-package doc states that it only operates on .gem files (so not the installed gem directory?). bundle-package doc声明它仅对.gem文件起作用(因此对已安装的gem目录无效)。
How can I freeze my particular version of the gem? 如何冻结特定版本的gem?
Copy your modified gem into a folder like vendor/gems
, and then point to that version in your Gemfile: 将修改后的gem复制到vendor/gems
等文件夹中,然后在Gemfile中指向该版本:
gem "modified_gem", :path => "vendor/gems/modified_gem"
And don't forget to check vendor/gems
into version control. 并且不要忘记将vendor/gems
检查到版本控制中。
Sorry for the brevity of this answer, let me know if you need clarification. 抱歉,这个答案很简短,如果您需要澄清,请告诉我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.