1

这是 application.html.erb 文件上的行 <%= stylesheet_link_tag yield(:css), media: "all", "data-turbolinks-track" => true %> 和 css 加载每个不同页面所需的文件名.

本地服务器中的结果非常好,在 Heroku 中,该命令提供的 css 会抛出“您要查找的页面不存在。

您可能输入了错误的地址或页面可能已移动。”

以防万一我尝试预编译资产。感谢您提前回复,我将继续显示日志:

C:\Sites\rankthisup>heroku run rake assets:precompile
Running `rake assets:precompile` attached to terminal... up, run.4248

C:\Sites\rankthisup>heroku logs
2013-07-28T03:15:15.339168+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2013-07-28T03:15:15.339168+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ionpack-4.0.0/lib/action_dispatch/middleware/static.rb:64:in `call'
2013-07-28T03:15:15.339168+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/lock.rb:17:in `call'
2013-07-28T03:15:15.339168+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/engine.rb:511:in `call'
2013-07-28T03:15:15.339460+00:00 app[web.1]:   vendor/ruby-1.9.3/lib/ruby/1.9.1/
webrick/server.rb:191:in `block in start_thread'
2013-07-28T03:15:15.339851+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/rack/logger.rb:21:in `block in call'
2013-07-28T03:15:15.339460+00:00 app[web.1]:   vendor/ruby-1.9.3/lib/ruby/1.9.1/
webrick/httpserver.rb:94:in `run'
2013-07-28T03:15:15.339460+00:00 app[web.1]:   vendor/ruby-1.9.3/lib/ruby/1.9.1/
webrick/httpserver.rb:138:in `service'
2013-07-28T03:15:15.339168+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-07-28T03:15:15.339168+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/application.rb:97:in `call'
2013-07-28T03:15:15.339460+00:00 app[web.1]: ActionController::RoutingError (No
route matches [GET] "/stylesheets/allrankings.css"):
2013-07-28T03:15:15.339460+00:00 app[web.1]:
2013-07-28T03:15:15.339460+00:00 app[web.1]:
2013-07-28T03:15:15.339460+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/rack/logger.rb:38:in `call_app'
2013-07-28T03:15:15.339460+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ionpack-4.0.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2013-07-28T03:15:15.339168+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-07-28T03:15:15.339460+00:00 app[web.1]:
2013-07-28T03:15:15.339460+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ionpack-4.0.0/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2013-07-28T03:15:15.339851+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ivesupport-4.0.0/lib/active_support/tagged_logging.rb:25:in `tagged'
2013-07-28T03:15:15.339851+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ivesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `tagged'
2013-07-28T03:15:15.339851+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ivesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2013-07-28T03:15:15.339851+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ivesupport-4.0.0/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2013-07-28T03:15:15.339851+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ionpack-4.0.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2013-07-28T03:15:15.339851+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/rack/logger.rb:21:in `call'
2013-07-28T03:15:15.340004+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/engine.rb:511:in `call'
2013-07-28T03:15:15.340004+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/application.rb:97:in `call'
2013-07-28T03:15:15.339851+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ionpack-4.0.0/lib/action_dispatch/middleware/static.rb:64:in `call'
2013-07-28T03:15:15.339851+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2013-07-28T03:15:15.339851+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/runtime.rb:17:in `call'
2013-07-28T03:15:15.340004+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/lock.rb:17:in `call'
2013-07-28T03:15:15.340004+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-07-28T03:15:15.340004+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-07-28T03:15:15.340004+00:00 app[web.1]:   vendor/ruby-1.9.3/lib/ruby/1.9.1/
webrick/httpserver.rb:138:in `service'
2013-07-28T03:15:15.340004+00:00 app[web.1]:   vendor/ruby-1.9.3/lib/ruby/1.9.1/
webrick/httpserver.rb:94:in `run'
2013-07-28T03:15:15.340004+00:00 app[web.1]:   vendor/ruby-1.9.3/lib/ruby/1.9.1/
webrick/server.rb:191:in `block in start_thread'
2013-07-28T03:15:15.340004+00:00 app[web.1]:
2013-07-28T03:15:15.340004+00:00 app[web.1]:
2013-07-28T03:15:15.709491+00:00 heroku[router]: at=info method=GET path=/favico
n.ico host=rankthisup.herokuapp.com fwd="200.81.44.68" dyno=web.1 connect=2ms se
rvice=8ms status=304 bytes=0
2013-07-28T03:21:46.287023+00:00 heroku[router]: at=info method=GET path=/favico
n.ico host=rankthisup.herokuapp.com fwd="200.81.44.68" dyno=web.1 connect=3ms se
rvice=7ms status=304 bytes=0
2013-07-28T03:21:49.857863+00:00 heroku[router]: at=info method=GET path=/styles
heets/categories.css host=rankthisup.herokuapp.com fwd="200.81.44.68" dyno=web.1
 connect=1ms service=9ms status=404 bytes=1351
2013-07-28T03:21:49.851502+00:00 app[web.1]: Started GET "/stylesheets/categorie
s.css" for 200.81.44.68 at 2013-07-28 03:21:49 +0000
2013-07-28T03:21:49.851575+00:00 app[web.1]: Started GET "/stylesheets/categorie
s.css" for 200.81.44.68 at 2013-07-28 03:21:49 +0000
2013-07-28T03:21:49.852815+00:00 app[web.1]:
2013-07-28T03:21:49.852815+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ionpack-4.0.0/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2013-07-28T03:21:49.852815+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ionpack-4.0.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2013-07-28T03:21:49.852815+00:00 app[web.1]: ActionController::RoutingError (No
route matches [GET] "/stylesheets/categories.css"):
2013-07-28T03:21:49.852815+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/rack/logger.rb:21:in `block in call'
2013-07-28T03:21:49.852815+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ivesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `tagged'
2013-07-28T03:21:49.852815+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/rack/logger.rb:21:in `call'
2013-07-28T03:21:49.852999+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ionpack-4.0.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2013-07-28T03:21:49.852815+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ivesupport-4.0.0/lib/active_support/tagged_logging.rb:25:in `tagged'
2013-07-28T03:21:49.852999+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/lock.rb:17:in `call'
2013-07-28T03:21:49.852999+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-07-28T03:21:49.852815+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/rack/logger.rb:38:in `call_app'
2013-07-28T03:21:49.852999+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2013-07-28T03:21:49.852999+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/runtime.rb:17:in `call'
2013-07-28T03:21:49.852999+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ivesupport-4.0.0/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2013-07-28T03:21:49.852999+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ionpack-4.0.0/lib/action_dispatch/middleware/static.rb:64:in `call'
2013-07-28T03:21:49.852999+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/engine.rb:511:in `call'
2013-07-28T03:21:49.853158+00:00 app[web.1]:   vendor/ruby-1.9.3/lib/ruby/1.9.1/
webrick/httpserver.rb:138:in `service'
2013-07-28T03:21:49.852815+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ivesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2013-07-28T03:21:49.853158+00:00 app[web.1]:
2013-07-28T03:21:49.853158+00:00 app[web.1]: ActionController::RoutingError (No
route matches [
GET] "/stylesheets/categories.css"):
2013-07-28T03:21:49.853158+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ionpack-4.0.0/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2013-07-28T03:21:49.853158+00:00 app[web.1]:   vendor/ruby-1.9.3/lib/ruby/1.9.1/
webrick/httpserver.rb:94:in `run'
2013-07-28T03:21:49.853158+00:00 app[web.1]:   vendor/ruby-1.9.3/lib/ruby/1.9.1/
webrick/server.rb:191:in `block in start_thread'
2013-07-28T03:21:49.852999+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/application.rb:97:in `call'
2013-07-28T03:21:49.852999+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-07-28T03:21:49.853687+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/rack/logger.rb:21:in `block in call'
2013-07-28T03:21:49.853687+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ivesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2013-07-28T03:21:49.853687+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ivesupport-4.0.0/lib/active_support/tagged_logging.rb:25:in `tagged'
2013-07-28T03:21:49.853687+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/rack/logger.rb:21:in `call'
2013-07-28T03:21:49.853158+00:00 app[web.1]:
2013-07-28T03:21:49.853930+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/engine.rb:511:in `call'
2013-07-28T03:21:49.853930+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/application.rb:97:in `call'
2013-07-28T03:21:49.853930+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/lock.rb:17:in `call'
2013-07-28T03:21:49.853930+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-07-28T03:21:49.853930+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-07-28T03:21:49.853158+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ionpack-4.0.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2013-07-28T03:21:49.853158+00:00 app[web.1]:
2013-07-28T03:21:49.853687+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ivesupport-4.0.0/lib/active_support/tagged_logging.rb:67:in `tagged'
2013-07-28T03:21:49.853687+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2013-07-28T03:21:49.853930+00:00 app[web.1]:   vendor/ruby-1.9.3/lib/ruby/1.9.1/
webrick/httpserver.rb:138:in `service'
2013-07-28T03:21:49.853930+00:00 app[web.1]:   vendor/ruby-1.9.3/lib/ruby/1.9.1/
webrick/httpserver.rb:94:in `run'
2013-07-28T03:21:49.853930+00:00 app[web.1]:   vendor/ruby-1.9.3/lib/ruby/1.9.1/
webrick/server.rb:191:in `block in start_thread'
2013-07-28T03:21:49.853930+00:00 app[web.1]:
2013-07-28T03:21:49.853687+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rac
k-1.5.2/lib/rack/runtime.rb:17:in `call'
2013-07-28T03:21:49.853158+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/rai
lties-4.0.0/lib/rails/rack/logger.rb:38:in `call_app'
2013-07-28T03:21:49.853687+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ionpack-4.0.0/lib/action_dispatch/middleware/static.rb:64:in `call'
2013-07-28T03:21:49.853930+00:00 app[web.1]:
2013-07-28T03:21:49.853687+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ionpack-4.0.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2013-07-28T03:21:49.853687+00:00 app[web.1]:   vendor/bundle/ruby/1.9.1/gems/act
ivesupport-4.0.0/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2013-07-28T03:21:50.724700+00:00 heroku[router]: at=info method=GET path=/favico
n.ico host=rankthisup.herokuapp.com fwd="200.81.44.68" dyno=web.1 connect=3ms se
rvice=7ms status=304 bytes=0
2013-07-28T03:22:34.593098+00:00 heroku[run.1552]: State changed from up to comp
lete
2013-07-28T03:22:34.571741+00:00 heroku[run.1552]: Process exited with status 0
2013-07-28T03:22:57.340524+00:00 heroku[api]: Starting process with command `bun
dle exec rake assets:precompile` by myxoh10@gmail.com
2013-07-28T03:23:01.652538+00:00 heroku[run.4248]: Awaiting client
2013-07-28T03:23:01.698517+00:00 heroku[run.4248]: Starting process with command
 `bundle exec rake assets:precompile`
2013-07-28T03:23:02.879867+00:00 heroku[run.4248]: State changed from starting t
o up
2013-07-28T03:23:10.507117+00:00 heroku[run.4248]: Process exited with status 0
2013-07-28T03:23:10.524617+00:00 heroku[run.4248]: State changed from up to comp
lete
4

1 回答 1

0

可能是 categories.css 不在编译列表中。你可以在 config/application.rb 中尝试这样的事情:

config.assets.precompile += ['categories.css']

替换实际文件名(可能是 categories.sass)。

于 2013-07-28T03:49:02.263 回答