CodeCrack CodeCrack - 6 months ago 52
CSS Question

Fixing SyntasticCheck bootstrap error. Vim Syntastic plugin

I am using Syntastic VIM plug in

All my bootstrap stuff is set up and works it's just I keep getting this error
in app/assets/stylesheets/application.css.scss

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

Line 17 is @import "bootstrap-sprockets";

My Gemfile has

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

my app/assets/stylesheets/application.css.scss just has

* 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";

Why does Syntastic still give me this error?

jan jan

Why does Syntastic still give me this error?

Syntastic gives you this error, because it doesn't know about about additional import paths set up by sprockets. But fortunately you can configure this with the variable g:syntastic_<filetype>_<checker>_args. So in your case you probably should set something like

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

or something simular.

Extra sugar: you can use to automagically set this variable for this project only