Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"gem.add_dependency" for another local gem

I am creating a gem, which has a dependency on another published gem. In my_gem.gemspec, I have added the dependency to the other gem:

gem.add_dependency "other_gem", "~> 1.0.0"

Now, I found a feature that can be tweaked in other_gem, so I forked the repository, made my changes and committed it to the fork (It has not been pulled into the original repository).

My question is how do I tell my_gem to lookup other_gem locally? The below code snippet is not valid, as :path is not an option in add_dependency call, as mentioned in Gem Specification Reference:

gem.add_dependency "other_gem", "~> 1.0.0", :path => '/path/to/local/other_gem

like image 353
Subhash Avatar asked Sep 11 '26 04:09

Subhash


1 Answers

Locally it's much easier: while you're doing development, you can include:

gem "other_gem", :path => '/path/to/local/other_gem'

or

gem "other_gem", :git => "[email protected]:/your_github/other_gem.git"

in your gemfile, as this should override the gemspec

like image 167
Max Avatar answered Sep 14 '26 00:09

Max