Application.css.scss causing issue with rails 4 - ruby-on-rails

So i've been learning ruby on rails and i decided to add some style to my new posts page on a myrubyblog app. Everything was working. After a few days i decided to import scss from the posts.scss file into the application.css.scss and well i get this error
RuntimeError in Home#index
Showing c:/Sites/myrubyblog/app/views/layouts/application.html.erb where line #5 raised:
Current ExecJS runtime does't support ES5. Please install node.js.
(in c:/Sites/myrubyblog/app/assets/stylesheets/application.css.scss)
Extracted source (around line #0):
After removing my application.css.scss file, the pages were working. Upon removing the actual scss code and leaving the application.css.scss the page began to give problems again. I decided to leave the application.css.scss file deleted. This for some reason allows for the styles i set in it to show up even though the stylesheet itself has been deleted.

Installing Node.js seemed to have worked. I just had to reboot.... twice...
Thx guys i guess.

Related

Rails momentary SCSS compilation error

(Rails 5.1 on Windows 10) When I modify the SCSS file (app/assets/stylesheets/mystyle.scss), I get this error (Error compiling CSS asset - Permission denied # utime_failed) in Chrome when immediately reloading the page which references it. If I load the page in the browser again, it works fine. I appreciate that the SCSS needs time to run but have not seen this (bad) behaviour before. Any suggestions?
I notice this different error when doing the same in Edge, which then gets replaced with the same error as above on the second attempt and then is fine on attempt #3:
The problem's disappeared. I think it was due to the SCSS file being included in the require_tree . manifest but the CSS file was also being referenced a few lines later in the HEAD. I noticed this and removed the second (CSS) reference.

Custom SCSS file is not importing

I'm working on a rails app and using Sass. So far everything has been done in the application.scss file which has worked great.
I'm having two issues which I think are caused by the same problem.
1) I created a users model which generated a users.scss file. When I started to use it, I noticed that it wasn't actually importing into the final web page. So at the top of the application.scss file I added #import "users". Which leads to issue 2.
2) When running the final page, I get a Syntax error:
Invalid CSS after "// VARIABLES": expected selector or at-rule, was "$hero-font: Lor..."
I'm wondering if I might have missed where the import is happening for the Sass files or am using them incorrectly?
Thanks!
I added back the *= require statements from the application.scss file.

Rails 4 not loading css.scss files

I had a Rails 4 app that was loading the css.scss files just fine. Then I did something to break it, I don't know what, and reverting to the last git check-in isn't fixing the problem.
My structure is exactly as rails new [project name] left it, and I've never had to look at how the assets get loaded. Reading up on the asset pipeline just left me more confused.
I'm actually putting all of my styling in app\assets\stylesheets\application.css.scss, which begins with
*= require_self
*= require_tree .
as I believe it should, but (judging from the Chrome developer tools view) the application isn't even getting as far as loading that. So where does a Rails 4 application get told to load app\assets\stylesheets\application.css.scss?
(Yes, I see others have problems with loading the stylesheets, but the advice always seems to be to put the stylesheets where I already have them or to include those lines in the application stylesheet that I already have, so it looks as if my problem is something else).

Bootstrap-sass gem not loading

Ran into an interesting problem and wondered if anyone else has as well.
I'm doing a Rails tutorial and part of the setup is installing the bootstrap-sass gem. The tutorial recommends for installing bootstrap, to rename the existing application.css file to application.css.scss, removing all the contents in that file, and then adding #import "bootstrap";.
I downloaded the tutorial's source code and ran it on my local machine and it works just fine.
However, when I implemented this in my code, no css stylings appeared. No errors appeared in the logs, either, though I noticed there was no GET request for the css occurring. I even went into the source code, clicked the css file and it appeared empty, while all the bootstrap javascript files were not empty.
After a while, I decided to implement bootstrap in the way that several other tutorials had done - I put the application.css.scss file back to its normal application.css file with all of the default contents that appear there, and then created a new file that I called styles.css.scss and put in the #import "bootstrap"; there and it loads it just fine.
I contacted a mentor of the program teaching the tutorial. He downloaded my source code from my github repo and saw exactly what I saw, though his project was working just fine, and no other students of the program had yet reported an issue doing it the way that the tutorial (and the bootstrap-sass docs) suggested.
Has anyone else ever run into this issue?

Sass::SyntaxError in Static_pages#contact

I'm following Hartl's tutorial (up to chapter 5 at this point - http://ruby.railstutorial.org/chapters/filling-in-the-layout#code-signup_button) and I feel as though I have followed his instructions but I keep getting this error message when I try and view my sample_app homepage online: Sass::SyntaxError in Static_pages#contact followed by File to import not found or unreadable: bootstrap. I have just added the bootstrap-sass gem to my Gemfile, have created the file app/assets/stylesheets/custom.css.scss and added Bootstrap CSS to that file (#import "bootstrap";). I've looked at a few similar threads searching for a solution and have tried a few options but nothing has worked. Any thoughts? Help would be greatly appreciated...
Pjumble, the point is you don't have to copy exactly what is shown in listings 5.6 and 5.7.
The three dots at the beggining mean you have to keep the previous contents of the file while adding the lines that follow.
So you start up with listing 5.5, then add some lines from listing 5.6, then add the rest of the lines from 5.7.

Resources