问题
I am developing two gems, let's call them foo and bar. Also foo has a runtime dependency on bar. I am developing both these gems with bundler.
How can I specify bar as a dependency of foo and have bundler resolve that dependency to a local path, without polluting my Gemfile? At the moment the only way I can see to do this is to put gem "bar", path: "path/to/bar"
in foo's Gemfile, and remove it once bar is on rubygems, but this solution is obviously unsatisfactory as it will break on anybody else's machine until that date.
回答1:
It is not clear if the dependency is runtime
or compile time
.
Have you tried installing bar
using the local .gem
file? Once installed in GEM_HOME
, your foo
gem should detect it
cd /path/to/bar
rake install
then
cd /path/to/foo
rake build
回答2:
You can specify the dependency as a git branch, and then map it to a local path using the instructions here: http://ryanbigg.com/2013/08/bundler-local-paths/
来源:https://stackoverflow.com/questions/19761326/how-can-i-develop-two-gems-together-with-bundler