升级到Rails 4后,不再生成public/assets/manifest.yml。而是存在不同的格式化的清单 - (指纹).json。 但在我看来,服务器仍在寻找旧的manifest.yml格式,忽略.json版本?Rails 4,Heroku无法识别预编译的清单(指纹).json
我看到类似问题的其他问题,但他们似乎被升级到Rails 4,为rails文件添加rails_12factor,设置serve_static_assets = true等,但这些解决方案似乎没有任何影响我的场景。
由于这个烦人的问题,我很累,没有灵感,任何帮助将不胜感激!从Heroku的
日志文件:
ActionController::RoutingError (No route matches [GET] "/assets/layouts/test/test.html"):
的Gemfile:
ruby '2.0.0'
gem 'rails', '4.0.0'
...
gem "compass-rails", github: "milgner/compass-rails", ref: "1749c06f15dc4b058427e7969810457213647fb8"
...
gem 'rails_12factor', group: :production
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
我使用的角度和他们的UI路由器,这是部分我的routes.js.coffee其中test.html链接:
.state "root",
url: "/"
views:
"root":
controller: "ApplicationController"
templateUrl: "/assets/layouts/test/test.html"
我也试过本地预编译,但由于我在这里也使用了Rails 4,所以仍然没有创建manifest.yml,只有.json版本。 当然,一切都工作得很好的发展...
所以我的实际cuestion: 如何使Heroku的识别和使用manifest-(指纹)以.json -file,或替代方式,使这项工作?
现在我实际上在这里找到了一个可用的解决方法:[没有路径与Rails中的资源/图像匹配](http://stackoverflow.com/a/11128672/2597056)。 将routes.js.coffee重命名为routes.js.coffe.erb,并将文件重命名为'templateUrl:“<%= asset_path('layouts/test/test.html')%>”'。 现在我只需要像这样更改源中的每个文件引用。其实,我认为这正是清单文件预期为我做的事情? – RastacraZ