twitter-bootstrap 没有路由匹配 [GET] "/assets/bootstrap.css.map"

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25480348/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 21:23:14  来源:igfitidea点击:

No route matches [GET] "/assets/bootstrap.css.map"

ruby-on-railstwitter-bootstrap

提问by kchoi

I'm running on rails4, bootstrap 3 and I get the following error message in my terminal.

我在 rails4, bootstrap 3 上运行,我在终端中收到以下错误消息。

Started GET "/assets/bootstrap.css.map" for 127.0.0.1 at 2014-08-24 23:41:36 -0700

ActionController::RoutingError (No route matches [GET] "/assets/bootstrap.css.map"):
  actionpack (4.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.1.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'


railties (4.1.4) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.1.4) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.1.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.1.4) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.1.4) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.1.4) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.1.4) 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.4) 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.4) lib/action_dispatch/middleware/static.rb:64:in `call'
  rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
  railties (4.1.4) lib/rails/engine.rb:514:in `call'
  railties (4.1.4) 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'

Anyone have any ideas how to get rid of this?

任何人有任何想法如何摆脱这个?

EDIT:

编辑:

This is my application.css

这是我的 application.css

*= require_tree .
*= require_self
*= require_ladda-themeless
*= require login_form
*= require bootstrap
*/

*= require_tree 。
*= require_self
*= require_ladda-themeless
*= 需要登录表单
*= 需要引导程序
*/

回答by Bruno Peres

The file that requests the bootstrap.css.mapis:

请求的文件bootstrap.css.map是:

/vendor/assets/stylesheets/bootstrap.css

/vendor/assets/stylesheets/bootstrap.css

And removing this last line should fix the problem:

删除最后一行应该可以解决问题:

/*# sourceMappingURL=bootstrap.css.map */

See herewhat are map files used for.

在这里查看地图文件的用途。

回答by Tom Henrik Aadland

I had the same problem and found this short answeron SO. From what I understand the map files are an aid to debugging tools in the browser. Quick fix is to find where this map file is included, by issuing a command line find.

我遇到了同样的问题,并在 SO 上找到了这个简短的答案。据我所知,地图文件有助于在浏览器中调试工具。快速修复是通过发出命令行查找来查找包含此映射文件的位置。

find . -name "*.css" -o -name "*.scss" | xargs grep 'sourceMappingURL=bootstrap.css.map'

Then either delete the line from your css file or move it to where it will be looking for it.

然后从您的 css 文件中删除该行或将其移动到要查找的位置。

回答by kchoi

Ok, so instead of having native bootstrap files under the app/assets folder, I just created custom.css.scss under app/assets/stylesheets and included @import "bootstrap";Then, I removed all the bootstrap files from app/assets folder which solved the problem.

好的,所以我没有在 app/assets 文件夹下拥有本机引导程序文件,而是在 app/assets/stylesheets 下创建了 custom.css.scss 并包含在内。@import "bootstrap";然后,我从解决了问题的 app/assets 文件夹中删除了所有引导程序文件。

回答by Saiprakash Holi

my error: ActionController::RoutingError (No route matches [GET] "/assets/bootstrap.min.css.map"):

我的错误:ActionController::RoutingError(没有路由匹配 [GET] "/assets/bootstrap.min.css.map"):

I created an empty bootstrap.min.css.map in assets folder, the error stopped.

我在资产文件夹中创建了一个空的 bootstrap.min.css.map,错误停止了。