I'm running the app and everything is working great in development but in production (heroku) I have some troubles with js files (doesn't load jquery properly and make some things to broke).
Are there something that is called differently on production in the assets ? Maybe some files are overriding others when it is compressed in heroku app. I just want to get the same result in both environments.
application.js
//= require jquery
//= require jquery.turbolinks
//= require jquery-ujs/src/rails
//= require jquery-ui
//= require bootstrap-sass/assets/javascripts/bootstrap
...
development.rb
Rails.application.configure do
config.action_mailer.delivery_method = :letter_opener
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.cache_classes = false
config.eager_load = false
config.consider_all_requests_local = true
if Rails.root.join('tmp/caching-dev.txt').exist?
config.action_controller.perform_caching = true
config.cache_store = :memory_store
config.public_file_server.headers = {
'Cache-Control' => 'public, max-age=172800'
}
else
config.action_controller.perform_caching = false
config.cache_store = :null_store
end
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_caching = false
config.active_support.deprecation = :log
config.active_record.migration_error = :page_load
config.assets.debug = true
config.assets.quiet = true
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = {host: "localhost:3000"}
end
production.rb
Rails.application.configure do
config.cache_classes = true
config.action_mailer.delivery_method = :smtp
config.eager_load = true
config.consider_all_requests_local = true
config.action_controller.perform_caching = true
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
config.assets.js_compressor = :uglifier
config.assets.compile = true
config.log_level = :debug
config.log_tags = [ :request_id ]
config.action_mailer.perform_caching = false
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.log_formatter = ::Logger::Formatter.new
if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
end
config.active_record.dump_schema_after_migration = false
end