1

在我的Rails 4应用程序中,每当我调用任何控制器动作或页面重装时,我的终端显示一些错误但我的应用程序工作正常,没有功能卡住,但我不知道为什么会发生这种情况,因为我现在已经注意到了。有什么办法可以解决它。ActionController :: RoutingError(没有路由匹配[GET]“/assets/bootstrap/glyphicons-halflings-regular.woff2”):

Started GET "/assets/bootstrap/glyphicons-halflings-regular.woff2" for 127.0.0.1 at 2016-03-04 15:49:29 +0530 

ActionController::RoutingError (No route matches [GET] "/assets/bootstrap/glyphicons-halflings-regular.woff2"): 
    actionpack (4.1.9) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' 
    actionpack (4.1.9) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' 
    railties (4.1.9) lib/rails/rack/logger.rb:38:in `call_app' 
    railties (4.1.9) lib/rails/rack/logger.rb:20:in `block in call' 
    activesupport (4.1.9) lib/active_support/tagged_logging.rb:68:in `block in tagged' 
    activesupport (4.1.9) lib/active_support/tagged_logging.rb:26:in `tagged' 
    activesupport (4.1.9) lib/active_support/tagged_logging.rb:68:in `tagged' 
    railties (4.1.9) lib/rails/rack/logger.rb:20:in `call' 
    request_store (1.2.0) lib/request_store/middleware.rb:8:in `call' 
    actionpack (4.1.9) lib/action_dispatch/middleware/request_id.rb:21:in `call' 
    rack (1.5.2) lib/rack/methodoverride.rb:21:in `call' 
    rack (1.5.2) lib/rack/runtime.rb:17:in `call' 
    activesupport (4.1.9) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call' 
    rack (1.5.2) lib/rack/lock.rb:17:in `call' 
    actionpack (4.1.9) lib/action_dispatch/middleware/static.rb:84:in `call' 
    rack (1.5.2) lib/rack/sendfile.rb:112:in `call' 
    railties (4.1.9) lib/rails/engine.rb:514:in `call' 
    railties (4.1.9) lib/rails/application.rb:144:in `call' 
    rack (1.5.2) lib/rack/lock.rb:17:in `call' 
    rack (1.5.2) lib/rack/content_length.rb:14:in `call' 
    rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service' 
    /home/praveen/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service' 
    /home/praveen/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run' 
    /home/praveen/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread' 


    Rendered /home/praveen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.1.9/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.5ms) 
    Rendered /home/praveen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.1.9/lib/action_dispatch/middleware/templates/routes/_route.html.erb (9.9ms) 
    Rendered /home/praveen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.1.9/lib/action_dispatch/middleware/templates/routes/_table.html.erb (3.2ms) 
    Rendered /home/praveen/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.1.9/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (96.6ms) 


Started GET "/assets/bootstrap/glyphicons-halflings-regular.woff" for 127.0.0.1 at 2016-03-04 15:49:29 +0530 

回答

1

在您的css文件中搜索@font-face并相应地设置您的资产的路径。

@font-face { 
font-family: 'FontAwesome'; 
src: url("<%= asset_path 'fontawesome-webfont.eot' %>"); 
src: url("<%= asset_path 'fontawesome-webfont.eot#iefix' %>") format('embedded-opentype'), url("<%= asset_path 'fontawesome-webfont.woff' %>") format('woff'), url("<%= asset_path 'fontawesome-webfont.ttf' %>") format('truetype'), url("<%= asset_path 'fontawesome-webfont.svg#fontawesomeregular' %>") format('svg'); 
font-weight: normal; 
font-style: normal; 
} 
+0

对不起,没有解决问题仍显示相同的错误。 –

相关问题