Abbas Aleid Abbas Aleid - 5 months ago 39
CSS Question

Ruby on rails: Stylesheets not working ExecJS::ProgramError

Error page:
enter image description here

Here's the application.html.erb file:

<!DOCTYPE html>
<html>
<head>
<title>YoutupediaBlog</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>

<%= yield %>

</body>
</html>


I have searched for solutions for this problem the past two days. I have tried many things.

Most solutions says to change 'application' to 'default' in the stylesheet_link_tag and javascript_include_tag. Which it dose work and the page is loaded successfully, but!! Stylesheet is not loading. My page styling is not shown.

Here's my posts.scss file (which it's in the app/assets/stylesheets directory)

body {
margin: 0;
font-family: proxima-nova, 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
h1 {
color: blue;
text-align: center;
background-color: #2A4550;
color: white;
margin: 0;
padding: 24px;
}


I'm so depressed right now, any help is appreciated.

Answer

I guess you missed nodejs, because i had some problems same as you.

You can try to do as following:

First, install NodeJS on your local machine (make sure the corresponding entry is added to the PATH)

Second, add gem 'execjs' to your Gemfile.

And run bundle install