更新本地gem源代码 [英] Update local gem source code
问题描述
我正在Rails项目中测试一颗宝石。
I'm testing a gem in a Rails project.
当前Gemfile:
gem 'mygemname', path: '/path/to/my/gem'
在本地编辑gem时,我可以构建gem ,从 Gemfile
中删除gem,运行 bundle install
,将gem添加回Gemfile并运行再次捆绑安装
。有没有更简单的本地方法?
When I edit a gem locally I can build the gem, remove the gem from Gemfile
, run bundle install
, add the gem back to the Gemfile and run bundle install
again. Is there an easier way to do this locally?
推荐答案
如果使用 bundle config local.GEM_NAME /从命令行获取路径/到/本地/ git /存储库
,那么每次重新加载应用程序时,它将从文件系统加载最新的源。
If you use bundle config local.GEM_NAME /path/to/local/git/repository
from the command line then every time you reload your application it will load the latest source from your file system.
要删除更改(将代码推送到GitHub或RubyGems后),您需要运行 bundle config --delete local.GEM_NAME
To remove the changes (when you have pushed your code to GitHub or RubyGems), you need to run bundle config --delete local.GEM_NAME
来源: http://bundler.io/v1.10/git.html
这篇关于更新本地gem源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!