如何在我的 Gemfile 中指定本地 .gem 文件? [英] How do I specify local .gem files in my Gemfile?

查看:12
本文介绍了如何在我的 Gemfile 中指定本地 .gem 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个通过 gem install xx.gem 安装的 gem 文件.我可以告诉 Bundler 使用它们吗?还是我必须指定源路径?

I have a couple of gem files which I install via gem install xx.gem. Can I tell Bundler to use them? Or do I have to specify the source path?

推荐答案

严格来说,这不是您关于安装 .gem 包的问题的答案,但您可以在通过编辑您的 Gemfile 逐个宝石基础.

This isn't strictly an answer to your question about installing .gem packages, but you can specify all kinds of locations on a gem-by-gem basis by editing your Gemfile.

gem "foreman", path: "/Users/pje/my_foreman_fork"

另外,指定 :git 属性将从远程 git 存储库安装 gem.

Alternately, specifying a :git attribute will install the gem from a remote git repository.

gem "foreman", git: "git://github.com/pje/foreman.git"

# ...or at a specific SHA-1 ref
gem "foreman", git: "git://github.com/pje/foreman.git", ref: "bf648a070c"

# ...or branch
gem "foreman", git: "git://github.com/pje/foreman.git", branch: "jruby"

# ...or tag
gem "foreman", git: "git://github.com/pje/foreman.git", tag: "v0.45.0"

(正如 @JHurrahhow-do-i-specify-local-gem-files-in-my-gemfile#comment6422126_5634086">他的评论.)

(As @JHurrah mentioned in his comment.)

这篇关于如何在我的 Gemfile 中指定本地 .gem 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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