當我運行rake RAILS_ENV=production assets:precompile --trace
來預編譯我的資產進行生產時,出現此錯誤。我添加了production.rb文件。資產預編譯錯誤
Invoke assets:precompile (first_time)
Invoke assets:environment (first_time)
Execute assets:environment
Invoke environment (first_time)
Execute environment
rake aborted!
No such middleware to insert before: ActionDispatch:Static
production.rb
Rails.application.configure do
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
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 = false
config.server_static_assets = false
config.log_level = :debug
config.action_mailer.perform_caching = false
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
這已經快把我逼瘋了兩天。任何幫助都是適當的。
你能告訴我們'production.rb'文件嗎? – Cyzanfar
@Cyzanfar我添加了production.rb文件。 – jrocc