0

I'm trying to use a Ruby gem that I created (Called "mygem"). But my rails application cannot find it. Can someone please advise why and how to fix it?

Step #1: Verify that mygem exists in my current directory:

$ pwd
/myDir
$ ls mygem-1.7.3.gem
-rw-r--r--  1 myuser  wheel  27136 Aug  6 11:41 mygem-1.7.3.gem

Step #2: Make sure the Gemfile says to pickup my gem from the right place:

$ grep mygem Gemfile
gem "mygem", :path => "/myDir"

Step #3: Do bundle install. But when I do that, it says it can't find it:

$ bundle install
Fetching gem metadata from http://rubygems.org/........
Fetching gem metadata from http://gems.myserver.com/...
Fetching additional metadata from http://rubygems.org/....
Fetching additional metadata from http://gems.myserver.com/..
Resolving dependencies...
Could not find gem 'mygem (>= 0) ruby' in source at /myDir.
Source does not contain any versions of 'mygem (>= 0) ruby'
Saqib Ali
  • 11,931
  • 41
  • 133
  • 272

1 Answers1

1

Try specifying the version number

gem "mygem", '1.7.3', :path => "/myDir"

Credit goes to this answer

Community
  • 1
  • 1
usha
  • 28,973
  • 5
  • 72
  • 93