在rails中使用Bootstrap Sass时出错 [英] Error on using Bootstrap Sass in rails
问题描述
我正在开发一个简单的ruby在rails应用程序,我得到以下错误:
I'm working on a simple ruby on rails application and I am getting the following error:
TypeError:无法读取属性的过程'of undefined(在/ home / saasbook / Documents / projects / Bookkeeper / app / assets / stylesheets / application.css.sass)
提取的来源如下:
<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 %>
此错误发生在我使用Bootstrap Sass插件添加Bootstrap Sass并按照教程
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'
我的代码
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"
页面顶部红色边框显示此标题, strong>
The page shows this title in the red border on top, is this any help?
Portal#index中的ExecJS :: ProgramError
推荐答案
似乎有一个问题,版本5.0的autoprefixer-rails gem。尝试降级到4.0.2.2。
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
如果您使用Node而不是RubyRacer,则会弹出您的JS运行时。
This will pop up if you are using Node instead of RubyRacer as your JS runtime.
EDIT -
这已在最新版本的autoprefixer中修复。
EDIT - This has been fixed in the latest version of autoprefixer.
bundle update autoprefixer-rails
这篇关于在rails中使用Bootstrap Sass时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!