RoR新秀在这里提出了一个关于Heroku部署的小问题。部署到Heroku时,资产管道未编译。我在网上尝试了很多建议但没有成功。在我的构建中,我看到"检测到清单文件,假设资产是在本地编译的,并且#34;消息和我的页面加载aplication.js和application.css抛出错误。
http://*masked-app-name*/assets/application-ae1bb08c08ec882f8d7005ca99addcfef89e47173e0ba1971862de4357d10918.js
Failed to load resource: the server responded with a status of 404 (Not Found)
Production.rb
CareForMe::Application.configure do
config.cache_classes = true
config.eager_load = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = true
config.assets.compress = true
config.assets.js_compressor = Uglifier.new(:beautify => true) if defined? Uglifier
config.assets.compile = true
config.assets.digest = true
config.assets.version = '1.0'
config.assets.raise_runtime_errors = true
config.log_level = :debug
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.log_formatter = ::Logger::Formatter.new
end
application.rb中
require File.expand_path('../boot', __FILE__)
require "active_record/railtie" require "action_controller/railtie"
require "action_mailer/railtie" require "sprockets/railtie"
Bundler.require(*Rails.groups)
module CareForMe
class Application < Rails::Application
end
end
非常感谢任何投入。如果这是一个重复的问题,我很抱歉,但到目前为止,我还没有成功地完成了对在线信息的所有尝试。 :)
由于
答案 0 :(得分:1)
之前我遇到过类似的问题。我所做的只是将其添加到我的config/application.rb
config.assets.initialize_on_precompile = false