0

I'm a complete moron when it comes to ruby, and I'm trying to clean up a build problem.

In a directory with two gems, one of which depends on the other, the dependency seems ok until runtime. Here's a test case:

https://github.com/dankegel/rdepdemo

And here's what happens when I run its demo.sh:

+ cd subdemo
+ bundle install
Using rake 10.5.0
Using bundler 1.16.5
Using minitest 5.11.3
Using subdemo 0.1.0 from source at `.`
Bundle complete! 4 Gemfile dependencies, 4 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
+ rake
...
2 runs, 2 assertions, 0 failures, 0 errors, 0 skips
+ gem build subdemo
  Successfully built RubyGem
  Name: subdemo
  Version: 0.1.0
  File: subdemo-0.1.0.gem
+ cd ../demo
+ bundle install
Using rake 10.5.0
Using bundler 1.16.5
Using subdemo 0.1.0 from source at `..`
Using demo 0.1.0 from source at `.`
Using minitest 5.11.3
Bundle complete! 4 Gemfile dependencies, 5 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
+ rake

File does not exist: subdemo

(The problem may be related to the fact that there's no top-level Gemfile sewing them together, but that's kind of a feature; our team really likes seeing separate build logs for each gem.)

Previous similar questions, without the runtime problem: How can I develop two gems together with Bundler? How do you develop multiple gems? Local Dependency in Gem .gemspec

Dan Kegel
  • 559
  • 5
  • 11

1 Answers1

0

A shy developer sent in this possible solution:

cd subdemo
bundle install
rake
gem build subdemo
gem install --install-dir . subdemo
cd ../demo
GEM_PATH=$GEM_PATH:../subdemo bundle install
GEM_PATH=$GEM_PATH:../subdemo rake
GEM_PATH=$GEM_PATH:../subdemo gem build demo

but I haven't tried it in the real world yet, and am still wondering if there are more kosher approaches.

Dan Kegel
  • 559
  • 5
  • 11