# Plugin dependencies

**URL:** <https://www.ruby-forum.com/t/plugin-dependencies/177790>\
**Category:** Rails\
**Created:** [October 23, 2009, 8:10pm UTC](https://www.ruby-forum.com/t/plugin-dependencies/177790 "2009-10-23T20:10:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marnen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@marnen](https://www.ruby-forum.com/u/marnen)\
**Post date:** [October 23, 2009, 8:10pm UTC](https://www.ruby-forum.com/t/plugin-dependencies/177790/1 "2009-10-23T20:10:32Z")

</div>

Hi everyone!

I’m writing my first ever Rails plugin, and I’m trying to figure out  
what the best way (in 2.3) to manage plugin dependencies is. Google  
doesn’t seem to yield much that is applicable to my current situation,  
and the Rails docs themselves are quite weak in this area (or I’m  
looking at the wrong class).

Basically, the situation is this: I have some common model functionality  
dealing with street addresses that I abstracted into a couple of  
modules. I decided it was worth wrapping up those modules into an  
acts\_as plugin (acts\_as\_addressed). One of the modules uses only core  
Rails features, and that was pretty easy to move into the plugin. The  
problem now is my other module, which uses some of the geocoding  
features provided by the YM4R plugin.

So…in this case, what’s the best way to specify that certain features  
of the acts\_as\_addressed plugin depend on the YM4R plugin? I’m hoping  
to release acts\_as\_addressed as a standalone plugin, and I’d like to  
enforce the dependency somehow so that my users don’t get random  
NameErrors. Does Rails provide a mechanism for this? Is there some  
other way I should structure my plugin? Any ideas would be appreciated.

Sorry if this is a stupid question – I’m not really all that familiar  
with the Rails plugin system, beyond using plugins in my applications.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![marnen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@marnen](https://www.ruby-forum.com/u/marnen)\
**Post date:** [October 23, 2009, 8:28pm UTC](https://www.ruby-forum.com/t/plugin-dependencies/177790/2 "2009-10-23T20:28:18Z")

</div>

On Oct 23, 7:10 pm, Marnen Laibow-Koser \<rails-mailing-l…@andreas-  
[s.net](http://s.net)\> wrote:

> Hi everyone!
> 
> I’m writing my first ever Rails plugin, and I’m trying to figure out  
> what the best way (in 2.3) to manage plugin dependencies is. Google  
> doesn’t seem to yield much that is applicable to my current situation,  
> and the Rails docs themselves are quite weak in this area (or I’m  
> looking at the wrong class).

basically there is very little support for dependencies, core’s  
position on this is ‘if you want dependencies, use gems’ (plugins can  
be loaded from gems). If the plugin you want to depend on isn’t  
available in gem form then it isn’t hard to make that plugin also work  
as a gem according to

> **[Home](https://www.practicalecommerce.com)**
>
> Practical Ecommerce: Independent analysis and strategy for online merchants — Amazon, SEO, analytics, marketing, design, payments, social media, cross-border, multichannel, shipping, much more.

Fred

---

<div class="post-metadata">

**Author:** ![marnen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/67e7ee/32.png) [@marnen](https://www.ruby-forum.com/u/marnen)\
**Post date:** [October 23, 2009, 9:15pm UTC](https://www.ruby-forum.com/t/plugin-dependencies/177790/3 "2009-10-23T21:15:59Z")

</div>

Frederick C. wrote:

> On Oct 23, 7:10ï¿½pm, Marnen Laibow-Koser \<rails-mailing-l…@andreas-  
> [s.net](http://s.net)\> wrote:
> 
> > Hi everyone!
> > 
> > I’m writing my first ever Rails plugin, and I’m trying to figure out  
> > what the best way (in 2.3) to manage plugin dependencies is. ï¿½Google  
> > doesn’t seem to yield much that is applicable to my current situation,  
> > and the Rails docs themselves are quite weak in this area (or I’m  
> > looking at the wrong class).
> 
> basically there is very little support for dependencies, core’s  
> position on this is ‘if you want dependencies, use gems’ (plugins can  
> be loaded from gems).

I was afraid of that.

> If the plugin you want to depend on isn’t  
> available in gem form then it isn’t hard to make that plugin also work  
> as a gem according to  
> [Practical Ecommerce | News, How to, Definitions, Guides, Examples](http://www.practicalecommerce.com/blogs/post/438-The-Blurring-Line-Between-Plugins-and-Gems)

Thanks! I’ll check that out.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

> Fred
