升级到 Rails 4 后,不再生成 public/assets/manifest.yml。相反,存在不同格式的 manifest-(fingerprint).json。但在我看来,服务器仍在寻找旧的 manifest.yml 格式,忽略 .json 版本?
我看到基于类似问题的其他问题,但它们似乎可以通过升级到 Rails 4、将 rails_12factor 添加到 gem 文件、设置 serve_static_assets = true 等来解决,但这些解决方案似乎都没有在我的场景中产生任何影响。
由于这个烦人的问题,我很累而且没有灵感,任何帮助将不胜感激!
Heroku 的日志文件:
ActionController::RoutingError (No route matches [GET] "/assets/layouts/test/test.html"):
宝石文件:
ruby '2.0.0'
gem 'rails', '4.0.0'
...
gem "compass-rails", github: "milgner/compass-rails", ref: "1749c06f15dc4b058427e7969810457213647fb8"
...
gem 'rails_12factor', group: :production
生产.rb
RailsFoundationAngular::Application.configure do
config.assets.initialize_on_precompile = false
config.cache_classes = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = true
config.assets.compress = true
config.assets.compile = false
config.assets.digest = true
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
config.action_dispatch.x_sendfile_header = nil
end
我正在使用 Angular 和他们的 ui-router,这是我的 routes.js.coffee 中链接 test.html 的部分:
.state "root",
url: "/"
views:
"root":
controller: "ApplicationController"
templateUrl: "/assets/layouts/test/test.html"
我也尝试过在本地进行预编译,但由于我在这里也使用 Rails 4,仍然没有创建 manifest.yml,只有 .json 版本。当然,一切都在开发中完美运行......
所以我的实际提示: 我如何让 Heroku 识别和使用 manifest-(fingerprint).json -file,或者其他方法来完成这项工作?