[Ruby] How to deal with SassC::SyntaxError in Pages#index that occurred during rails5 intermediate tutorial

less than 1 minute read

An error occurred during rails5 intermediate tutorial The following error image 415e5c6c8622f2ea3ffb780959431d92.png

Hypothesis and what we tried

Translating the explanation of the error statement

“Error: The file to import cannot be found or read: bootstrap-sprockets. 15:1 line in app/assets/stylesheets/application.scss @import “bootstrap-sprockets”;”

Becomes It is hypothesized that sprockets do not exist, although import is written.

Many sites that appear when searching with error sentences are said to be because rails s was not used, but in my case I restart with rails s but it has no effect. Reference site

Resolution

I was able to solve it by messing with application.scss

application.scss before modification


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

Delete the third line

application.scss

```after modifying ruby

@import “bootstrap-sprockets”; @import “bootstrap”; ```

Apparently it was because I was accidentally importing protospace when I was browsing some sites to solve it. Therefore, the solution was to write rails s shortage and wrong import.