Tag : execjsprogramerror

[Fixed] CSS loading issue after fixing ExecJS::ProgramError in page

I have manage to fix my ExecJS::ProgramError as mentioned in my last post.

The error got disappeared as soon as I change the “application” to “default”. But the issue I faced now is, my app is unable to locate and load the CSS and JS. None of the styles got loaded.

I tried to inspect the issue. Looked into the source rendered in the browser by choosing the “view source” option.

ViewSourceInBrowser

From the source it looks like the app is trying to locate the default.css and default.js, which is not present.

Fix I followed

Categories: Ruby On Rails

Fixing ExecJS::ProgramError in page

How I got the issue

Created a new project in rails
$ rails new StaticPageDemo

Added static_page controller to it with home action
$ rails generate controller static_page home

Ran the server
$ rails server

Got this error while tried to access the page in http://localhost:3000/static_page/home

ExecJS programError

Solution

After some search in Google, I got a solution from this link, which helped me fixing the issue. I also learned, It is an issue with the windows. The application parameter works on the web server.

Opened the application.html.erb in app/views/layouts folder of StaticPageDemo project. Replaced application with default.

Categories: Ruby On Rails

%d bloggers like this: