So this took me awhile to figure out, because the answer is, it's in TWO places. Do this:
- In your gem's Gemfile (yes, Gemfile, not .gemspec), add the source line for your private gem server. If you're also pulling from RubyGems, then it'll look something like this:
source 'http://rubygems.org' source 'http://myrubygems.mycompany.example.com:8808' # Or wherever your gems are hosted internally (or externally) gemspec
- Then, in your mynewgem.gemspec put the following:
Gem::Specification.new do |gem| # [...] gem.add_dependency 'myoldgem' # the gem hosted at myrubygems.mycompany.example.com:8808 end
The reason this works is probably obvious: Your Gemfile specifies the source for your gems and your .gemspec specifies the dependencies.
Hope this saves someone a few minutes.