加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – bootstrap:导入的文件未找到或不可读

发布时间:2020-12-17 03:36:16 所属栏目:百科 来源:网络整理
导读:我已经找到了一些关于我的问题的主题,但我不明白应该如何修复它. 我正在关注http://ruby.railstutorial.org/chapters/filling-in-the-layout#fnref-5_5教程,并在app / assets / stylesheets / custom.css.scss中导入引导程序. 那是我的Gemfile: source 'htt
我已经找到了一些关于我的问题的主题,但我不明白应该如何修复它.

我正在关注http://ruby.railstutorial.org/chapters/filling-in-the-layout#fnref-5_5教程,并在app / assets / stylesheets / custom.css.scss中导入引导程序.

那是我的Gemfile:

source 'https://rubygems.org'
gem 'bootstrap-sass','2.0.4'
gem 'rails','3.2.8'

group :development,:test do
gem 'sqlite3','1.3.5'
gem 'rspec-rails','2.11.0'
end

Gems used only for assets and not required
in production environments by default.
group :assets do
gem 'sass-rails','3.2.5'
gem 'coffee-rails','3.2.2'
gem 'uglifier','1.2.3'
end

gem 'jquery-rails','2.0.2'

group :test do
gem 'capybara','1.1.2'
end

group :production do
gem 'pg','0.12.2'
end

我在localhost / sample_app / home上遇到了什么错误

Sass::SyntaxError in Static_pages#home

Showing c:/Users/katja/Arbeit/rails_projects/sample_app/app/views/layouts/application.html.erb where line #5 raised:

File to import not found or unreadable: bootstrap.
Load path: Sass::Rails::Importer(c:/Users/katja/Arbeit/rails_projects/sample_app/app/assets/stylesheets/custom.css.scss)
(in c:/Users/katja/Arbeit/rails_projects/sample_app/app/assets/stylesheets/custom.css.scss)
Extracted source (around line #5):

2: 
3:

4: <%= full_title(yield(:title)) %>
5: <%= stylesheet_link_tag "application",media: "all" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: <!--[if lt IE 9]>
Rails.root: c:/Users/katja/Arbeit/rails_projects/sample_app
Application Trace | Framework Trace | Full Trace
app/assets/stylesheets/custom.css.scss:1
app/views/layouts/application.html.erb:5:in `app_views_layouts_application_html_erb_16020705_20168520'

我正在使用Windows和GitBash.我已经尝试删除tmp / cache,它没有帮助.
一切都运行得很完美,但是当我添加@import“bootstrap”时;到cusom.css.scss,我收到一个错误.

解决方法

重新启动Web服务器“rails s”.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读