# Bundler for Rails 3 Engine

**URL:** <https://www.ruby-forum.com/t/bundler-for-rails-3-engine/188155>\
**Category:** Rails\
**Created:** [May 6, 2010, 5:31pm UTC](https://www.ruby-forum.com/t/bundler-for-rails-3-engine/188155 "2010-05-06T17:31:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![churp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f14d63/32.png) [@churp](https://www.ruby-forum.com/u/churp)\
**Post date:** [May 6, 2010, 5:31pm UTC](https://www.ruby-forum.com/t/bundler-for-rails-3-engine/188155/1 "2010-05-06T17:31:44Z")

</div>

Hello All,

My google-fu did not find this answer :

How do I configure a Rails-3 Engine so that the engine’s Gemfile is  
integrated with the parent-Rails-app’s bundle?  
Thanks

Peter F.  
(847) 859-9550  
Email: removed\_email\_address@domain.invalid  
IM GTalk: peter.fitzgibbons  
IM AOL: removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![churp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f14d63/32.png) [@churp](https://www.ruby-forum.com/u/churp)\
**Post date:** [May 6, 2010, 8:52pm UTC](https://www.ruby-forum.com/t/bundler-for-rails-3-engine/188155/2 "2010-05-06T20:52:33Z")

</div>

On Thu, May 6, 2010 at 8:29 AM, Peter F.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello All,  
> My google-fu did not find this answer :  
> How do I configure a Rails-3 Engine so that the engine’s Gemfile is  
> integrated with the parent-Rails-app’s bundle?

You package your plugin as a gem, then add it as a dependency to your  
Rails app.

Write up a yourplugin.gemspec and put gem ‘yourplugin’, :path =\>  
‘/to/your/plugin’ in your app try.

jeremy

---

<div class="post-metadata">

**Author:** ![churp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f14d63/32.png) [@churp](https://www.ruby-forum.com/u/churp)\
**Post date:** [May 11, 2010, 2:59pm UTC](https://www.ruby-forum.com/t/bundler-for-rails-3-engine/188155/3 "2010-05-11T14:59:10Z")

</div>

> > How do I configure a Rails-3 Engine so that the engine’s Gemfile is  
> > integrated with the parent-Rails-app’s bundle?
> 
> You package your plugin as a gem, then add it as a dependency to your Rails app.
> 
> Write up a yourplugin.gemspec and put gem ‘yourplugin’, :path =\>  
> ‘/to/your/plugin’ in your app try.

Hi Jeremy,

I’m not sure you answered the OP’s question (as I’m looking for the  
same answer). He wants to know, if he has a Gemfile within his gem/  
engine how can he get the Rails app/Bundler to automatically load it’s  
dependencies along with the Rails app’s hardcoded dependencies.

For example, if you create your own Rails 3 Engine gem called MyShop  
and MyShop has a dependency on ActiveMerchant, he wants to put that  
dependency in a Gemfile within MyShop and not within the Rails app  
itself.

I agree with this (your Rails app shouldn’t need to know what the  
dependencies are for the dependencies you have, Bundler should just  
take care of them) and I’m trying to do the same thing.

Cheers,

Andy

---

<div class="post-metadata">

**Author:** ![churp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f14d63/32.png) [@churp](https://www.ruby-forum.com/u/churp)\
**Post date:** [September 17, 2010, 4:17pm UTC](https://www.ruby-forum.com/t/bundler-for-rails-3-engine/188155/4 "2010-09-17T16:17:31Z")

</div>

I’m looking for the same! Is it possible?

---

<div class="post-metadata">

**Author:** ![churp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f14d63/32.png) [@churp](https://www.ruby-forum.com/u/churp)\
**Post date:** [May 15, 2010, 4:21pm UTC](https://www.ruby-forum.com/t/bundler-for-rails-3-engine/188155/5 "2010-05-15T16:21:49Z")

</div>

Me too. Anyone figured it out yet?

---

<div class="post-metadata">

**Author:** ![churp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f14d63/32.png) [@churp](https://www.ruby-forum.com/u/churp)\
**Post date:** [September 17, 2010, 4:28pm UTC](https://www.ruby-forum.com/t/bundler-for-rails-3-engine/188155/6 "2010-09-17T16:28:40Z")

</div>

On Tuesday 11 May 2010, andyjeffries wrote:

> I’m not sure you answered the OP’s question (as I’m looking for the  
> same answer). He wants to know, if he has a Gemfile within his gem/  
> engine how can he get the Rails app/Bundler to automatically load  
> it’s dependencies along with the Rails app’s hardcoded dependencies.

Jeremy answered the question. Really. Gemfiles are for apps, not for  
gems. You specify a gem’s dependencies through its gemspec. Have a look  
at all the gems on github or try

$ gem specification activemerchant --ruby

to get an idea.

> I agree with this (your Rails app shouldn’t need to know what the  
> dependencies are for the dependencies you have, Bundler should just  
> take care of them) and I’m trying to do the same thing.

That’s what bundler does. It’s up to you to declare the dependencies in  
the appropriate way. For gems that means in a gemspec.

Michael

–  
Michael S.  
[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[http://www.schuerig.de/michael/](http://www.schuerig.de/michael/)
