gpt4 book ai didi

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

转载 作者:数据小太阳 更新时间:2023-10-29 07:05:04 25 4
gpt4 key购买 nike

我正在开发一个简单的 ruby​​ on rails 应用程序,但出现以下错误:

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 之后

摘录下方指出错误位于:

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"

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

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

关于css - 在 rails 中使用 Bootstrap Sass 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27946932/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com