Refactored the template.rb script to configure gems just before setting up specs.