1

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.

Community
  • 1
  • 1
Ryan-Neal Mes
  • 6,003
  • 7
  • 52
  • 77

1 Answers1

1

If you really just want to get the gem up and working locally you can try downloading it and placing in vendor/gems, and adding this to your Gemfile:

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

If the gem works you can make the repo public and see if you still have issues grabbing it with bundler. Might not be ideal, but it will at least allow you to play with the gem before making it public.

NM Pennypacker
  • 6,704
  • 11
  • 36
  • 38