# Putting plugins/config in gem

**URL:** <https://www.ruby-forum.com/t/putting-plugins-config-in-gem/65160>\
**Category:** Ruby\
**Created:** [February 10, 2006, 12:31am UTC](https://www.ruby-forum.com/t/putting-plugins-config-in-gem/65160 "2006-02-10T00:31:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Payton\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/74df32/32.png) [@Payton\_S](https://www.ruby-forum.com/u/Payton_S)\
**Post date:** [February 10, 2006, 12:31am UTC](https://www.ruby-forum.com/t/putting-plugins-config-in-gem/65160/1 "2006-02-10T00:31:57Z")

</div>

I wrote a tool in ruby which I want to put entirely in a gem. The tool,  
however, requires a directory of plugins and a config file, which the  
tool should ideally be able to find in default locations.

I can include the plugin and config directories in the GemSpec without  
any trouble, but when the tool is run, it needs to be able to find them.

The only way I could figure out to do this was to hard-code this into  
the tool:

def where\_am\_i?  
“#{Gem.path}/gems/tool-#{VERSION}”  
end

And append the plugin and config paths to it. Surely there’s a better  
way to do all of this. Suggestions?

-Payton

---

<div class="post-metadata">

**Author:** ![Payton\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/74df32/32.png) [@Payton\_S](https://www.ruby-forum.com/u/Payton_S)\
**Post date:** [February 10, 2006, 6:30pm UTC](https://www.ruby-forum.com/t/putting-plugins-config-in-gem/65160/2 "2006-02-10T18:30:16Z")

</div>

I realize that I could have the config file automatically created in the  
user’s home directory, but what about the plugins directory? I guess  
that should be user-centric also, by default, but GemSpec doesn’t  
provide (afaik) a mechanism to install files in arbitrary locations.

-Payton
