ruby on rails - Loading local gems through Bundler and mounted apps -
i'm creating gem (let's call mygem
) sinatra server intended mounted within rack based apps.
inside gem's gemspec file, have following:
gem.add_dependency 'kss'
and inside gem's gemfile, have following
source 'https://rubygems.org' gemspec gem "kss", :path => "/users/me/code/kss"
now when running server within mygem
's folder, works expected: instead of fetching out kss dependency, on local drive , load version.
the problem comes in when add mygem
rails test app gemfile. in rails test app gemfile, have following line:
gem "mygem", :path => "/users/me/code/mygem"
i expect, upon bundle install
, bundler load mygem
, dependencies; kss
dependency, instead of loading local dependency, bundler fetches out rubygems find , load it. i'm assuming because in case, it's reading gemspec line , not including dependency override.
is there can fix behavior? i'd able run , test stuff locally, bundler doesn't seem recognize dependency overrides higher level app.
i'm open suggestions or changes if i'm going wrong way.
dependencies listed in gemspec become dependencies of implementing application, while dependencies defined in gemfile not become dependencies of implementing application. think should able adjust rails test app gemfile be:
gem "kss", :path => "/users/me/code/kss" gem "mygem", :path => "/users/me/code/mygem"
Comments
Post a Comment