在Rails Gemfile中,如何引用PR中的提交



我们需要修补救援,显然有人已经在这里创建了PR——https://github.com/resque/resque-web/pull/157/commits/0972517d6e42eeb096555a17346937d6df100d82

然而,我不知道如何在我的Gemfile中引用它。我试过这个

gem 'resque-web', git: 'https://github.com/maincocode/resque-web.git', branch: 'diei:master'

但这导致

Fetching https://github.com/maincocode/resque-web.git
fatal: Needed a single revision
Git error: command `git rev-parse --verify diei:master` in directory
/Users/myuser/.rvm/gems/ruby-3.0.2@myproject/cache/bundler/git/resque-web-aed087cc6342f9e701d8c32bd331a4830cb8747f
has failed.
Revision diei:master does not exist in the repository https://github.com/maincocode/resque-web.git. Maybe you
misspelled it?
If this error persists you could try removing the cache directory
'/Users/myuser/.rvm/gems/ruby-3.0.2@myproject/cache/bundler/git/resque-web-aed087cc6342f9e701d8c32bd331a4830cb8747f'

在运行bin/bundle安装时。类似地,尝试引用提交

gem 'resque-web', git: 'https://github.com/maincocode/resque-web.git', ref: '0972517d6e42eeb096555a17346937d6df100d82'

中的结果

Fetching https://github.com/maincocode/resque-web.git
fatal: Could not parse object '0972517d6e42eeb096555a17346937d6df100d82'.
Git error: command `git reset --hard 0972517d6e42eeb096555a17346937d6df100d82` in directory
/Users/myuser/.rvm/gems/ruby-3.0.2@myproject/bundler/gems/resque-web-0972517d6e42 has failed.
Revision 0972517d6e42eeb096555a17346937d6df100d82 does not exist in the repository
https://github.com/maincocode/resque-web.git. Maybe you misspelled it?
If this error persists you could try removing the cache directory
'/Users/myuser/.rvm/gems/ruby-3.0.2@myproject/bundler/gems/resque-web-0972517d6e42'

您必须引用提交的原始源,比如:

gem 'resque-web', git: 'https://github.com/diei/resque-web.git', ref: '0972517d6e42eeb096555a17346937d6df100d82'

您是否可能在0972517d6e42eeb096555a17346937d6df100d82所在的地方分叉了resque回购,而不是diei的回购?提交位于https://github.com/diei/resque-web/commit/0972517d6e42eeb096555a17346937d6df100d82并且还没有出现在resque/resque web中。

相关内容

  • 没有找到相关文章

最新更新