【发布时间】:2020-04-14 03:22:00
【问题描述】:
我真的很简单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 呢?
【问题讨论】:
-
这能回答你的问题吗? How to install gem from GitHub source? 或 this
-
如果它被合并到主分支中,为什么需要那个特定的提交,如(拉取请求)(github.com/rebelidealist/stripe-ruby-mock/pull/623)中所示?
-
@AlexanderSantos 我不太确定。我有一个测试项目。正是使用 gem 测试通过的这个提交。当我使用另一个修订版时 - 测试失败。这就是为什么 ????♂️ 我只是无法使用此修订版获得我想念的东西。我将此修订缓存在我的计算机上并且一切正常,但是当我在另一台计算机上运行
bundle时,Bundler 无法根据 Gemfile 获取 gem -
标记它,并通过标记而不是提交来获取它
-
但是该提交已合并到主仓库中,所以您是否尝试仅使用
https://github.com/rebelidealist/stripe-ruby-mock而不使用分支或提交?实际上尝试注释掉所有内容并只使用核心宝石?如果您可以让主存储库正常工作,那么使用 gem 的分支是不好的做法。我
标签: ruby-on-rails ruby github rubygems bundler