Bundling gems for drop-in apps

7 views
Skip to first unread message

Chason Choate

unread,
Jan 17, 2015, 11:02:19 PM1/17/15
to ruby-b...@googlegroups.com
I'm doing a bit of research for an app framework I would like to create. I have a question about how Bundler could load multiple Gemfile for different applications all under a shared framework. Here's the structure:

<root>
  |--- Gemfile
  |--- apps/
  |      |--- app1/
  |      |      |--- Gemfile
  |      |      |--- vendor/
  |      |             |--- bundle/
  |      |--- app2/
  |             |--- Gemfile
  |             |--- vendor/
  |                    |--- bundle/
  |--- server.rb
  |--- vendor/
         |--- bundle/

# <root>/server.rb
require 'rubygems'
require 'bundler/setup'

require 'all gems for the framework'

# Load the Gemfiles and require gems for all the apps
# Or possibly tell the apps to loads their gems somehow

So the root level app is responsible for loading it's own gems and then somehow loading the other apps gems. Is this possible with Bundler? If so I would love to hear how I could implement that. If not, I would also be interesting in other methods of getting this to work. 

Thanks for reading!





André Arko

unread,
Jan 18, 2015, 10:03:26 PM1/18/15
to ruby-b...@googlegroups.com
You should make each app a gem, like Rails engines are, and then put those gems into the root Gemfile. Bundler does not provide a way to load other Gemfiles.

--
You received this message because you are subscribed to the Google Groups "ruby-bundler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-bundler...@googlegroups.com.
To post to this group, send email to ruby-b...@googlegroups.com.
Visit this group at http://groups.google.com/group/ruby-bundler.
For more options, visit https://groups.google.com/d/optout.

Jordi Massaguer

unread,
Jan 19, 2015, 5:16:32 AM1/19/15
to ruby-b...@googlegroups.com
gemfile is actually a ruby file, thus I am sure you could load the other gemfiles and evaluate them in the root gemfile.

Reply all
Reply to author
Forward
0 new messages