what is the best to use - ruby gems or ruby plugins

*爱你&永不变心* 提交于 2019-12-14 01:22:14

问题


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:


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.




回答2:


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.




回答3:


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 :)



来源:https://stackoverflow.com/questions/2825711/what-is-the-best-to-use-ruby-gems-or-ruby-plugins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!