gpt4 book ai didi

html - Ruby on Rails - 导入 Bootstrap 错误 "File not found or unreadable"

转载 作者:行者123 更新时间:2023-11-28 07:32:16 25 4
gpt4 key购买 nike

我是 RoR 的新手,目前正在使用名为 Cloud9 的云 IDE 进行开发。我开发了一个运行良好的应用程序,但是在更新我的 css 文件时,当我启动我看到的网站时不知从哪里冒出来

Error: File to import not found or unreadable: bootstrap-sprockets.
on line 1 of .../app/assets/stylesheets/custom.css.scss

1: @import "bootstrap-sprockets";
2: @import "bootstrap";

这出现在 HTML 页面的左上角,我不确定为什么,因为所有 CSS 都已正确加载。这个错误随机出现,我不知道如何摆脱它。

自定义.css.scss

@import "bootstrap-sprockets";
@import "bootstrap";

/* universal */

body {
padding-top: 60px;
}

section {
overflow: auto;
}

textarea {
resize: vertical;
}

.center {
text-align: center;
}

.center h1 {
margin-bottom: 10px;
}

/* typography */

h1, h2, h3, h4, h5, h6 {
line-height: 1;
}

h1 {
font-size: 3em;
letter-spacing: -2px;
margin-bottom: 30px;
text-align: center;
}

h2 {
font-size: 1.2em;
letter-spacing: -1px;
margin-bottom: 30px;
text-align: center;
font-weight: normal;
color: #777;
}

p {
font-size: 1.1em;
line-height: 1.7em;
}

/* header */

#logo {
float: left;
margin-right: 10px;
font-size: 1.7em;
color: #777;
text-transform: uppercase;
letter-spacing: -1px;
padding-top: 9px;
font-weight: bold;
&:hover {
color: white;
text-decoration: none;
}
}

/* forms */

@mixin box_sizing {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}

input, textarea, select, .uneditable-input {
border: 1px solid #bbb;
width: 100%;
margin-bottom: 15px;
@include box_sizing;
}

input {
height: auto !important;
}

.checkbox {
margin-top: -10px;
margin-bottom: 10px;
span {
margin-left: 20px;
font-weight: normal;
}
}

#session_remember_me {
width: auto;
margin-left: 0;
}

gem 文件

source 'https://rubygems.org'

gem 'rails', '4.2.2'
gem 'bootstrap-sass', '3.3.1'
gem 'autoprefixer-rails'
gem 'devise'
gem 'sprockets-rails'
gem 'uglifier', '2.5.3'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '4.0.3'
gem 'turbolinks', '2.3.0'
gem 'jbuilder', '2.2.3'
gem 'sdoc', '0.4.0', group: :doc

group :development, :test do
gem 'sqlite3', '1.3.9'
gem 'byebug', '3.4.0'
gem 'web-console', '2.0.0.beta3'
gem 'spring', '1.1.3'
end

group :test do
gem 'minitest-reporters', '1.0.5'
gem 'mini_backtrace', '0.1.3'
gem 'guard-minitest', '2.3.1'
end

group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor', '0.0.2'
end

enter image description here

最佳答案

尝试像这样将扩展名添加到 application.js 文件中:

//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require turbolinks
//= require_tree .

关于html - Ruby on Rails - 导入 Bootstrap 错误 "File not found or unreadable",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31436474/

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