2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-03-04 16:06:46 -05:00
|
|
|
# Check that the app is configured correctly. Raise some helpful errors if something is wrong.
|
|
|
|
|
2017-07-27 21:20:09 -04:00
|
|
|
if defined?(Rails::Server) && Rails.env.production? # Only run these checks when starting up a production server
|
2013-03-04 16:06:46 -05:00
|
|
|
|
2013-03-25 13:33:13 -04:00
|
|
|
if ['localhost', 'production.localhost'].include?(Discourse.current_hostname)
|
|
|
|
puts <<END
|
2013-03-04 16:06:46 -05:00
|
|
|
|
2013-03-25 13:33:13 -04:00
|
|
|
Discourse.current_hostname = '#{Discourse.current_hostname}'
|
|
|
|
|
|
|
|
Please update the host_names property in config/database.yml
|
|
|
|
so that it uses the hostname of your site. Otherwise you will
|
|
|
|
experience problems, like links in emails using #{Discourse.current_hostname}.
|
|
|
|
|
|
|
|
END
|
|
|
|
|
|
|
|
raise "Invalid host_names in database.yml"
|
|
|
|
end
|
|
|
|
|
2017-07-27 21:20:09 -04:00
|
|
|
if !Dir.glob(File.join(Rails.root, 'public', 'assets', 'application*.js')).present?
|
2013-03-25 13:33:13 -04:00
|
|
|
puts <<END
|
|
|
|
|
|
|
|
Assets have not been precompiled. Please run the following command
|
|
|
|
before starting the rails server in production mode:
|
|
|
|
|
|
|
|
rake assets:precompile
|
2013-03-04 16:06:46 -05:00
|
|
|
|
|
|
|
END
|
|
|
|
|
2013-03-25 13:33:13 -04:00
|
|
|
raise "Assets have not been precompiled"
|
|
|
|
end
|
2015-04-24 13:10:43 -04:00
|
|
|
end
|