From 2bcd669b23a27f25f31252e2bf83dfa77ce1cdac Mon Sep 17 00:00:00 2001 From: Vinay Patel Date: Mon, 8 Sep 2014 09:11:06 +0000 Subject: [PATCH] Correcting Bundler.require in application.rb We had deviated from the standard Rails 3.2.x Bundler.require directive. When we upgraded to the latest version of bootstrap-sass, Publisher deploys started failing during assets precompilation: govuk_setenv publisher bundle exec rake \ RAILS_ENV=production RAILS_GROUPS=assets \ assets:precompile @alext pointed this out, and suggested this change to keep configs consistent with other Rails 3.2.x apps. --- config/application.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/config/application.rb b/config/application.rb index 6a0dbcd81..688c47609 100644 --- a/config/application.rb +++ b/config/application.rb @@ -7,9 +7,12 @@ require "rails/test_unit/railtie" require "sprockets/railtie" -# If you have a Gemfile, require the gems listed there, including any gems -# you've limited to :test, :development, or :production. -Bundler.require(:default, Rails.env) if defined?(Bundler) +if defined?(Bundler) + # If you precompile assets before deploying to production, use this line + Bundler.require(*Rails.groups(:assets => %w(development test))) + # If you want your assets lazily compiled in production, use this line + # Bundler.require(:default, :assets, Rails.env) +end module Publisher class Application < Rails::Application