无法访问开发中的预编译资产

时间:2017-05-15 08:25:30

标签: ruby-on-rails asset-pipeline

我运行了"Unknown column 'order.zip_code' in 'where clause' 并生成了资产,但在尝试加载时遇到了404错误。我在启动服务器之前设置了rake assets:precompile

  

,[2017-05-15T04:15:17.160326#48336]致命 - :[05dd2f39-ef90-4e83-8c9f-ebf8b95f04c8] ActionController :: RoutingError(没有路由匹配[GET]" / assets /application-872309cf4425a9e40a65887b0a33e1511227d2fa3ba299b0090a6709833ce9bc.css"):

该文件存在。

RAILS_ENV=production

Rails 5.0.2

1 个答案:

答案 0 :(得分:0)

这很有用。

>set RAILS_SERVE_STATIC_FILES=true

并重新启动服务器。在production.rb

中找到了这个
  # Disable serving static files from the `/public` folder by default since
  # Apache or NGINX already handles this.
  config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?

我在使用Puma。

相关问题