gpt4 book ai didi

css - 修复 SyntasticCheck Bootstrap 错误。 Vim 语法插件

转载 作者:行者123 更新时间:2023-12-02 06:16:36 24 4
gpt4 key购买 nike

我正在使用 Syntastic VIM 插件

我所有的 bootstrap 东西都已经设置好并且可以工作了,只是我一直收到这个错误在 app/assets/stylesheets/application.css.scss

|| File to import not found or unreadable: bootstrap-sprockets. Load path: ... on line 17

第17行是@import "bootstrap-sprockets";

我的 Gemfile 有

gem 'rails', '4.2.0'
gem 'sass-rails', '~> 5.0'
gem 'bootstrap-sass', '~> 3.3.3'

我的 app/assets/stylesheets/application.css.scss 有

/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
*/

@import "bootstrap-sprockets";
@import "bootstrap";

为什么 Syntastic 仍然给我这个错误?

最佳答案

Why does Syntastic still give me this error?

Syntastic 给你这个错误,因为它不知道 sprockets 设置的额外导入路径。 .但幸运的是,您可以使用变量 g:syntastic_<filetype>_<checker>_args 来配置它.所以在你的情况下你可能应该设置类似

let g:syntastic_scss_sass_args="--load-path path/to/bootstrap-gem/vendor/assets"

或类似的东西。

加糖:可以用https://github.com/embear/vim-localvimrc仅为这个元素自动设置这个变量

关于css - 修复 SyntasticCheck Bootstrap 错误。 Vim 语法插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29041876/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com