RailsApps / rails_apps_composer

A gem with recipes to create Rails application templates for Rails starter apps.
http://railsapps.github.io/rails_apps_composer/
1.42k stars 306 forks source link

Set default version of gem in defaults file #343

Open sonxurxo opened 8 years ago

sonxurxo commented 8 years ago

How can I specify the default version of a gem in the defaults file?

It seems that i reads gems as individual strings, so I can't see the way to set something like

gems:
- mysql2, '~> 0.3.18'

Currently I have an issue with Rails 4.1.2 and mysql2 0.4.1, and I like to switch back to a previous version of mysql2 gem with no luck. The same happens when trying to specify a github source for a gem.

Is there a way to achieve this, or should I first create a template and modify it?

vfonic commented 8 years ago

You could create a recipe instead of a gem. It's a bit of an overhead, but hey, no additional template editing. :)

https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/admin.rb#L12

https://github.com/RailsApps/rails_apps_composer/wiki/tutorial-rails-apps-composer#anatomy-of-a-recipe

DanielKehoe commented 8 years ago

Yes this would be a nice enhancement. I'll keep it in mind but it's not a top priority.

In the meantime, I've corrected the problem with the mysql gem: https://github.com/RailsApps/rails_apps_composer/commit/e3e0872a05baf6cfa5250d9e2d52d0c1b7355763