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

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

发布时间:2020-12-16 22:17:49 所属栏目:百科 来源:网络整理
导读:我比较新的编程,所以我希望这个问题不是绝对愚蠢的. 我的rails应用程序有一个问题. 我尝试使用bootstrap.我建立了一个名为“custom.css.scss”的文件,并在其中使用了“@import”引导“”行. 问题是:每次保存我的“custom.css.scss”文件时,会自动生成一个新
我比较新的编程,所以我希望这个问题不是绝对愚蠢的.

我的rails应用程序有一个问题.

我尝试使用bootstrap.我建立了一个名为“custom.css.scss”的文件,并在其中使用了“@import”引导“”行.

问题是:每次保存我的“custom.css.scss”文件时,会自动生成一个新的文件“custom.css”,并且我收到以下消息:“custom.css.scss要导入的文件未找到或不可读:bootstrap ”.

有趣的是:当我删除文件“custom.css.scss”并刷新我的浏览器,一切都很好(这意味着:使用引导).

你有什么想法,可能是什么原因?

最亲切的问候
克里斯

这是我安装的宝石文件

source 'https://rubygems.org'

gem 'rails','3.2.11'
gem 'bootstrap-sass','2.1'
gem 'bcrypt-ruby','3.0.1'
gem 'faker','1.0.1'
gem 'will_paginate','3.0.3'
gem 'bootstrap-will_paginate','0.0.6'
gem 'jquery-rails','2.0.2'

group :development,:test do
  gem 'sqlite3','1.3.5'
  gem 'rspec-rails','2.11.0'
  # gem 'guard-rspec','1.2.1'
  # gem 'guard-spork','1.2.0'  
  # gem 'spork','0.9.2'
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

group :test do
  gem 'capybara','1.1.2'
  gem 'factory_girl_rails','4.1.0'
  gem 'cucumber-rails','1.2.1',:require => false
  gem 'database_cleaner','0.7.0'
  gem 'launchy','2.1.0'
  # gem 'rb-fsevent','0.9.1',:require => false
  # gem 'growl','1.0.3'
end

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

custom.css.scss文件看起来像这样

@import "bootstrap";

/* universal */

html {
    overflow-y:scroll
}

body {
    padding-top: 60px
}

section {
    overflow: auto;
}

textarea {
    resize: vertial;
}

.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.7em;
    letter-spacing: -1px;
    margin-bottom: 30px;
    text-align: center;
    font-weight: normal;
    color: #999;
}

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

解决方法

我有一个类似的问题,看到了Habax的解决方案,并尝试了最后一步.

我刚刚重新启动了服务器.

原来是足够的.希望有帮助.

(编辑:李大同)

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

    推荐文章
      热点阅读