热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

在rails中使用BootstrapSass时出错

如何解决《在rails中使用BootstrapSass时出错》经验,为你挑选了1个好方法。

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

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

提取的来源如下:



<%= 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并遵循本教程后发生此错误

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

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

我的代码

application.html.erb


 
 
    <%= 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 %>

 
 
    <%= yield %>
         

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"

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

ExecJS::ProgramError in Portal#index



1> 小智..:

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


而不是降级`autoprefixer-rails` gem版本添加`gem&#39;therubyracer&#39;,平台:: ruby​​`帮助我摆脱了报告的错误.谢谢.
推荐阅读
author-avatar
淡而有味调_740
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有