How to mine gems where one depends on another

I have a gem A that has an addiction to gem B. Both gemstones are my own and are currently in private development. I am not going to publish them in rubigem.

I want to use gem A in my rails application.

The problem is I am getting this error when I try to run the package install for my rails app.

Could not find gem 'B (> = 0) ruby' required from gem 'A (> = 0) ruby', in any of the sources.

in my rails application in my Gemfile i have

gem 'A', :path => "/path/to/A'

      

in gem A gemspec I have

gem.add_dependency 'B'

      

and in Gemfile I have explicitly set location B so

gem 'omusubi', :path => "path/to/B'

      

The above configuration doesn't seem to work when I try to start my rails app.

However, when I run each of the gem test suites, they run fine.

I believe the problem is when I run rails app and the packager downloads dependency A, it only looks at the Gemspec, ignoring the gemfile. This is probably intended. So how can I get my code to work without having to publish my personal gems at this point in development.

+3


source to share


1 answer


One possibility is to hard-code B dependency in your Gemfile application using the: path option. In this case, the Bundler must resolve it correctly.



+1


source







All Articles