Joshua Muheim
Joshua Muheim

Reputation: 13233

Gemfile: Make sure some gems are available on the machine, but don't need to be loaded for the project

I didn't work with RoR for 2-3 years, but now I'm back in business, and I really like the bundle command. But I'm a bit unsure how to make sure my fellow developers have all gems installed that are not strictly part of the Rails application.

For example, we use YARD for documentation. YARD doesn't have anything to do with the Rails project we are working on, so I'm not sure whether I should add it to its Gemfile. On the other hand, this is the only way to make sure every developer has it installed automatically.

And if I add it to Gemfile, how exactly should I do it? In the :development group, so it doesn't get loaded for production? But strictly speaking, it also shouldn't be loaded in development, it simply just be installed so it can be used manually.

So how should I add it? Thanks, guys, for help.

Upvotes: 1

Views: 341

Answers (2)

Nathan Kleyn
Nathan Kleyn

Reputation: 5143

The :development group in the Gemfile is exactly the right place for this. There are nice commands that mean users can install only specific groups they need. See the docs for more information on groups with Bundler.

You can look at the Rails project's Gemfile itself to note that they have a group called :doc which they use to the same effect.

Upvotes: 1

bento
bento

Reputation: 2099

If you feel the :development scope in your App Gemfile is not the right place, you could go for a shared Gemfile that exists just for this purpose. (That is, set up a repository somewhere just containing this Gemfile, run bundle install on it and the gems will be installed locally).

Upvotes: 1

Related Questions