mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 10:14:52 -06:00
If assets haven't been precompiled, fail to start server in production mode with a message
This commit is contained in:
parent
c372e36cb6
commit
ba315c6610
@ -1,6 +1,8 @@
|
||||
# Check that the app is configured correctly. Raise some helpful errors if something is wrong.
|
||||
|
||||
if Rails.env.production? && ['localhost', 'production.localhost'].include?(Discourse.current_hostname)
|
||||
if defined?(Rails::Server) and Rails.env.production? # Only run these checks when starting up a production server
|
||||
|
||||
if ['localhost', 'production.localhost'].include?(Discourse.current_hostname)
|
||||
puts <<END
|
||||
|
||||
Discourse.current_hostname = '#{Discourse.current_hostname}'
|
||||
@ -13,3 +15,17 @@ END
|
||||
|
||||
raise "Invalid host_names in database.yml"
|
||||
end
|
||||
|
||||
if !Dir.glob(File.join(Rails.root,'public','assets','application*.js')).present?
|
||||
puts <<END
|
||||
|
||||
Assets have not been precompiled. Please run the following command
|
||||
before starting the rails server in production mode:
|
||||
|
||||
rake assets:precompile
|
||||
|
||||
END
|
||||
|
||||
raise "Assets have not been precompiled"
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user