Ruby on rails RoR路由错误

Ruby on rails RoR路由错误,ruby-on-rails,ruby,Ruby On Rails,Ruby,我已经将css放在样式表文件夹中,将图像放在图像文件夹中。这两个文件夹都位于MyRails应用程序的公用文件夹中。但是,我不断遇到以下错误: Started GET "/assets/blueprint/print.css" for 127.0.0.1 at Sat Nov 12 07:36:49 -0500 2011 Served asset /blueprint/print.css - 404 Not Found (2ms) ActionController::RoutingError (

我已经将css放在样式表文件夹中,将图像放在图像文件夹中。这两个文件夹都位于MyRails应用程序的公用文件夹中。但是,我不断遇到以下错误:

Started GET "/assets/blueprint/print.css" for 127.0.0.1 at Sat Nov 12 07:36:49 -0500 2011
Served asset /blueprint/print.css - 404 Not Found (2ms)

ActionController::RoutingError (No route matches [GET] "/assets/blueprint/print.css"):


Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.3ms)


Started GET "/assets/custom.css" for 127.0.0.1 at Sat Nov 12 07:36:49 -0500 2011
Served asset /custom.css - 404 Not Found (2ms)

ActionController::RoutingError (No route matches [GET] "/assets/custom.css"):


Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.4ms)


Started GET "/assets/logo.png" for 127.0.0.1 at Sat Nov 12 07:36:49 -0500 2011
Served asset /logo.png - 404 Not Found (3ms)

ActionController::RoutingError (No route matches [GET] "/assets/logo.png"):

我做错了什么?谢谢。

看起来您正在使用3.1。尝试将样式表和js文件放在assets目录下。请参阅关于如何使用资产管道的部分

我在尝试包含正确的资产时遇到了类似的问题,但我使用的是 轨道3.2.6。这对我很有用:

gem install sprockets
然后

bundle install

来源:

谢谢你的快速回答。它现在正在工作,但会在控制台中记录:“serviced asset/custom.css-304 Not Modified(0ms)”。这是某种错误还是正常?再次感谢。这没什么好担心的-这只是意味着资源自上次提供以来没有改变-请看,这只是资源没有改变的信息,因此可以使用缓存(请参阅并在那里搜索304)。