views:

14

answers:

2

Both methods put the gem into the project's folder to be a self-contained project. Is there advantage / disadvantage of these methods or one better than the other method?

(the project is a Rails 2.2 project, so can't use Bundler)

+1  A: 

Plug ins are falling out of fashion in the Rails world lately because they are harder to maintain, I guess or because they are considered a less elegant solution.

Besides, you can use Bundler in a 2.2 project (I have experience doing it with a 2.3 and 2.2 should be the same, right?). You only need to set up an initializer in your config/initializers folder: http://docs.heroku.com/bundler#using-bundler-from-rails-23x

Abel Tamayo
+2  A: 

The difference, and the reason plugins have fallen out of favor, is that a plugin is installed once, and can't easily be tracked or updated. Plus, you have to re-install that plugin from the web every time. If you have a fast-changing plugin, then the next time you use it in a project it might be drastically different than it is today.

Gems have two big advantages:

  • You can always go back and get whatever past version of a gem you want.
  • Gems you've installed on your system can be used on new projects without re-downloading from the web.
  • If you create gems that depend on other gems, you can specify the exact versions of those dependencies that are needed.

I hope this helps!

Jaime Bellmyer
Hi, can you please accept one of our answers so we get credit for helping you? Thanks!
Jaime Bellmyer