微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

css – 在rails中使用Bootstrap Sass时出错

我正在使用rails应用程序上的简单 ruby,我收到以下错误

TypeError:无法读取未定义的属性“进程”(在/ 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并遵循此tutorial后发生此错误

在摘录下面,它表明错误在:

应用程序/视图/布局/ 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','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"

页面在红色边框顶部显示标题,这有什么帮助吗?

Portal#index中的ExecJS :: ProgramError

解决方法

autoprefixer-rails gem的5.0版本似乎存在问题.尝试降级到4.0.2.2.

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

如果您使用Node而不是RubyRacer作为JS运行时,则会弹出.

编辑 –
这已在最新版本的autoprefixer中修复.

bundle update autoprefixer-rails

原文地址:https://www.jb51.cc/css/242323.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。