2

我不确定我何时开始收到此消息,但错误消息仅出现在我的开发服务器上。生产 heroku 服务器不报告任何内容。

Started GET "/assets/bootstrap_and_overrides.css?body=1" for 127.0.0.1 at 2013-06-08 16:57:30 -0700
Served asset /bootstrap_and_overrides.css - 304 Not Modified (0ms)


Started GET "/assets/" for 127.0.0.1 at 2013-06-08 16:57:30 -0700
Served asset / - 404 Not Found (5ms)

ActionController::RoutingError (No route matches [GET] "/assets"):
  actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.13) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  railties (3.2.13) lib/rails/engine.rb:479:in `call'
  railties (3.2.13) lib/rails/application.rb:223:in `call'
  rack (1.4.5) lib/rack/content_length.rb:14:in `call'
  railties (3.2.13) lib/rails/rack/log_tailer.rb:17:in `call'
  thin (1.5.1) lib/thin/connection.rb:81:in `block in pre_process'
  thin (1.5.1) lib/thin/connection.rb:79:in `catch'
  thin (1.5.1) lib/thin/connection.rb:79:in `pre_process'
  thin (1.5.1) lib/thin/connection.rb:54:in `process'
  thin (1.5.1) lib/thin/connection.rb:39:in `receive_data'
  eventmachine (1.0.3) lib/eventmachine.rb:187:in `run_machine'
  eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
  thin (1.5.1) lib/thin/backends/base.rb:63:in `start'
  thin (1.5.1) lib/thin/server.rb:159:in `start'
  rack (1.4.5) lib/rack/handler/thin.rb:13:in `run'
  rack (1.4.5) lib/rack/server.rb:268:in `start'
  railties (3.2.13) lib/rails/commands/server.rb:70:in `start'
  railties (3.2.13) lib/rails/commands.rb:55:in `block in <top (required)>'
  railties (3.2.13) lib/rails/commands.rb:50:in `tap'
  railties (3.2.13) lib/rails/commands.rb:50:in `<top (required)>'
  script/rails:6:in `require'
  script/rails:6:in `<main>'
4

1 回答 1

0

不确定您为什么要尝试读取资产目录。但是您在开发服务器上看不到 /assets 的原因是 rails 将在开发模式下为 /app/assets/stylesheets 提供资产,用于存在的项目,但由于没有通往 /assets 的路线(通过检查rake routes)你得到一个错误。

生产rake assets:precompile中是在您上传到 heroku 期间执行的,因此会创建并填充目录 /public/assets。

你可以rake assets:precompile在你的开发机器上看看会发生什么。

于 2013-06-09T00:28:01.720 回答