Error when using Bootstrap Sass in rails

I am working on a simple ruby ​​on rails application and I am getting the following error:

TypeError: Cannot read property 'process' of undefined (in/home/saasbook/Documents/projects/Bookkeeper/app/assets/stylesheets/application.css.sass)

The extracted source is as follows:

 <html> <head> <title>Bookkeeper</title> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> //Highlighted error line in extract <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> 

This error occurred after I added Bootstrap Sass using the Bootstrap Sass plugin and following this tutorial

Below the excerpt, it is stated that the error is:

app/views/layouts/application.html.erb:5:in_app_views_layouts_application_html_erb__226809778_88444660'

My code

application.html.erb

 <!DOCTYPE html> <html> <head> <title>Bookkeeper</title> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> //Highlighted error line in extract <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> </head> <body> <%= yield %> </body> </html> 

application.css.sass

 /* * 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 vendor/assets/stylesheets of plugins, if any, 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" 

The page shows this name in a red frame at the top, is this any help?

ExecJS::ProgramError in Portal#index

+6
source share
2 answers

The problem seems to be related to autoprefixer-rails self-service version 5.0. Try downgrading to 4.0.2.2.

https://github.com/ai/autoprefixer-rails/issues/47

This will appear if you use Node instead of RubyRacer as the JS runtime.

EDIT - This has been fixed in the latest version of autoprefixer.

 bundle update autoprefixer-rails 
+8
source

This is fixed in the latest version of autoprefixer. Update using the following command -

 bundle update autoprefixer-rails 
0
source

Source: https://habr.com/ru/post/981001/


All Articles