简体   繁体   中英

Error on using Bootstrap Sass in rails

I'm 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 by Using the Bootstrap Sass plugin and following this tutorial

Below the extract its stated that the error is at:

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 title in the red border on top, is this any help?

ExecJS::ProgramError in Portal#index

There seems to be an issue with version 5.0 of the autoprefixer-rails gem. Try downgrading to 4.0.2.2.

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

This will pop up if you are using Node instead of RubyRacer as your JS runtime.

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

bundle update autoprefixer-rails

This has been fixed in the latest release of autoprefixer. Upgrade using the following command -

bundle update autoprefixer-rails

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM