# Transforming simple ruby files into a ruby gem

**URL:** <https://meta.discourse.org/t/transforming-simple-ruby-files-into-a-ruby-gem/103399>\
**Category:** Development\
**Created:** [December 3, 2018, 9:56pm UTC](https://meta.discourse.org/t/transforming-simple-ruby-files-into-a-ruby-gem/103399 "2018-12-03T21:56:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)\
**Post date:** [December 4, 2018, 3:09am UTC](https://meta.discourse.org/t/transforming-simple-ruby-files-into-a-ruby-gem/103399/2 "2018-12-04T03:09:00Z")

</div>

Glad to here you are working on your first plugin 🙂. I would look at the [examples of other plugins](https://github.com/search?p=4&q=topic%3Adiscourse-plugin+org%3Adiscourse&type=Repositories) and see how they do the ruby side of things.

I don’t think your plugin actually needs to have a Gemfile, but you need to specify all of your [dependencies and sub-dependencies](https://meta.discourse.org/t/specify-external-gem-dependencies-for-plugins/16430/4) inside of your `plugin.rb` file. Discourse will then install all of the gems when it loads the plugin. See this example:

> <https://github.com/xfalcox/discourse-backups-to-dropbox/blob/master/plugin.rb>

> [@SebastianADW](#):
>
> I have 4 different ruby files with different kind of methods in it, i like to have them splitted.

Any files your plugin uses you can put inside of the “lib” folder and then require them inside of `plugin.rb`.

> <https://github.com/discourse/discourse-data-explorer/blob/main/plugin.rb#L579>

---

_[View the full topic](https://meta.discourse.org/t/transforming-simple-ruby-files-into-a-ruby-gem/103399)._
