本文介绍了Rails:未找到或无法读取要导入的文件:“引导程序"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对编程比较陌生,因此我希望这个问题不是绝对愚蠢的.

I am relatively new to programming, therefore I hope that the question is not absolutely stupid.

我的 rails 应用程序出现问题.

I got a problem concerning my rails app.

我尝试使用引导程序.我构建了一个名为custom.css.scss"的文件,并在其中使用了@importbootstrap""行.

I try to use bootstrap. I built a file called "custom.css.scss" and used the "@import "bootstrap"" line in it.

问题是:每次我保存custom.css.scss"文件时,都会自动生成一个新文件custom.css",我收到以下消息:找不到要导入的custom.css.scss文件或不可读:引导程序".

The problem is: Each time I save my "custom.css.scss" file a new file "custom.css" is automatically generated and I get the following message: "custom.css.scss File to import not found or unreadable:bootstrap".

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

The funny thing is: When I delete the file "custom.css.scss" and refresh my browser, everything is fine (which means: bootstrap is used).

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

Do you have any idea, what could be the reason?

最诚挚的问候克里斯

P.S.:这是我安装的 gem 文件

P.S.: This is my installed gem file

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 文件如下所示

The custom.css.scss file look like this

@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 的解决方案,先尝试了最后一步.

I had a similar problem and saw Habax's solution and tried the last step first.

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

事实证明这已经足够了.希望有所帮助.

That turned out to be enough. Hope that helps.

这篇关于Rails:未找到或无法读取要导入的文件:“引导程序"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 06:44