[英]Installing a gem using a commit's hash
我有非常简单的Gemfile
:
source 'https://rubygems.org'
gem 'stripe-ruby-mock',
github: 'mnin/stripe-ruby-mock',
require: 'stripe_mock',
ref: 'b6446fb5ae2b14b6703554cbea4ebd466e4f3c47'
当我运行bundle
命令来安装这个 gem 时,我收到这个错误:
root@6bcff6bf3997:/app# bundle
The git source `git://github.com/mnin/stripe-ruby-mock.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
Fetching git://github.com/mnin/stripe-ruby-mock.git
fatal: Could not parse object 'b6446fb5ae2b14b6703554cbea4ebd466e4f3c47'.
Revision b6446fb5ae2b14b6703554cbea4ebd466e4f3c47 does not exist in the repository git://github.com/mnin/stripe-ruby-mock.git. Maybe you misspelled it?
但我可以使用此链接https://github.com/mnin/stripe-ruby-mock/commit/b6446fb5ae2b14b6703554cbea4ebd466e4f3c47访问 Github 上的提交页面。
那么我怎样才能使用这个提交的哈希值呢?
如果可能,尽量不要使用分叉的 gem。 但是,如果您需要锁定分叉版本,请确保您拥有该分叉。 Fork 分支,将其合并到您自己的 repo 的主分支,然后在您的 gemfile 中使用该 repo。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.