Bundle install not installing gem from github

时间:2015-07-08 15:51:00

标签: ruby-on-rails ruby bundler

I am trying to import a gem directly from github into my application and I keep getting the error below.

Updating https://username:password@github.com/my-repo/moodle-api.git
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Could not find gem 'moodle-api (>= 0) ruby' in https://username:password@github.com/my-repo/moodle-api.git (at
v1.1).
Source does not contain any versions of 'moodle-api (>= 0) ruby'

I have found multiple posts with similar problems but none of the solutions seem to work.

Bundle install error: Source does not contain any versions of

'Could not find gem' error when specifying a forked version of a gem from Github in my gemfile

I am importing it using

gem 'moodle-api', :git => 'https://username:password@github.com/my-repo/moodle-api.git', :tag => 'v1.1'

The name of the gem is moodle-api and the gemspec file has the name moodle-api.gemspec. The version is setup correctly as well.

Any ideas? I am pretty stumped.

1 个答案:

答案 0 :(得分:1)

如果您真的只想获得宝石并在本地工作,您可以尝试下载并置于供应商/宝石中,并将其添加到您的Gemfile中:

gem 'moodle-api', path: 'vendor/gems/moodle-api'

如果宝石有效,你可以公开回购,看看你是否仍有问题用捆绑器抓住它。可能不理想,但它至少会让你在公开之前玩宝石。