如何告诉 Gem 文件使用 gem 的特定本地副本 [英] How to tell the Gem File to use a specific local copy of a gem
本文介绍了如何告诉 Gem 文件使用 gem 的特定本地副本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我有一颗快乐的宝石生活在:
Say I have a gem living happily at:
/MyPath/MyGem.gem
而且我想使用本地和独特的 gem,而不是来自 Github 的 gem 版本,或者它从任何地方获取它.
And I want to use the local and unique gem rather than a gem version from Github, or wherever it fetches it from.
如何指定我想使用 /MyPath/MyGem.gem
推荐答案
试试,在你的 Gemfile
:
gem "mygem", :path => "/MyPath/MyGem.gem"
请注意,最好在其中使用相对链接,例如:
Note that it's probably best to use a relative link in there, like:
gem "mygem", :path => "vendor/MyPath/MyGem.gem"
这篇关于如何告诉 Gem 文件使用 gem 的特定本地副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文