diff --git a/config/application.rb b/config/application.rb index ce2481c..95a699b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,29 +1,34 @@ require File.expand_path('../boot', __FILE__) require 'rails/all' -# Require the gems listed in Gemfile, including any gems +# Production doesn't use bundler # you've limited to :test, :development, or :production. -Bundler.require(*Rails.groups) +if ENV['RAILS_ENV'] != 'production' + Bundler.require(*Rails.groups) +else + # Dependencies to load before starting rails in production + require 'jquery-rails' +end module Base class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. # Store/Read localtime from the database config.active_record.default_timezone = :local # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de config.autoload_paths << Rails.root.join('lib') config.x = {} end def self.settings Application.config.x end end diff --git a/config/boot.rb b/config/boot.rb index 5e5f0c1..4b70168 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,4 +1,8 @@ # Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) +# Production doesn't use bundler +if ENV['RAILS_ENV'] != 'production' + ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) + + require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) +end