views:

211

answers:

3

Hi All,

What is the best practice when creating a rails project

1 - is it good to use ruby gems 2 - or is it good to use ruby plugins (as almost all the gems has their plugin versions)

and what are the strengths and weaknesses of eachoption

  • consider we are creating the rails project with rails 2.x.x or rails 3

thanks in advance

cheers, sameera

+1  A: 

I think you should have to go with gems if possible. You will have a rich framework with slim applications. If you use a lot of plugins your application will be too heavy. I'm talking from experience. I have an application with a lot of plugins in it and it is hell slow.

dombesz
I agree, but would like to note that sometimes plugins can offer more than gems. Like Engines (in Rails3 it is called mountable apps): where part of your application comes from the plugin, and thus can be shared between sites.
nathanvda
This doesn't really make sense. Plugins and gems load the same code so there shouldn't be a speed difference. The only way plugins can weigh your app down is if you have some installed that you aren't using.
ryeguy
+2  A: 

I prefer to use gems because then I can manage them with Bundler and it will install the necessary dependencies for me. It will also cache gems, which solves deployment issues.

Also, it isn't possible to use only plugins, there are always gem dependencies, and I'd rather use just one mechanism, so that's another point for gems.

I think that plugins are slowly turning into gems and Rails 3 is moving further in that direction.

Alex - Aotea Studios
A: 

In my case, I use gems whenever I can but I do use plugins when I don't have access to gems on the host.

For example, Heroku doesn't have all the gems and neither does Media Temple. Since plugins are imported with the project, you can get away with it :)

Elxx