问题描述
我已经安装了基础,当我编辑并保存app.scss文件时,它将在我项目的sass文件夹中创建一个 app.css和一个 config.rb文件。当我打开 app.css文件时,我得到了这个
语法错误:找不到要导入的文件或不可读的文件:Foundation /常见/比例。
然后在此之下我得到这个:
找不到或不可读的导入文件:Foundation / common / ratios。
加载路径:
/ Applications / MAMP / htdocs / WebApp02 / sass
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/blueprint/stylesheets
/ Applications / MAMP / htdocs / WebApp02 / sass //第1行上的/Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets
Compass :: SpriteImporter
/Applications/MAMP/htdocs/WebApp02/sass/app.scss
$ b $第2行的_settings.scss
b
然后是我的宝石的一堆路径。
在我想知道是否在我的sass文件夹中从未创建过app.css和config.rb文件任何人都可以解释为什么会这样。指南针仍然符合样式表文件夹中的app.css,但我想修复此问题,以防止将来发生任何错误。
config.rb文件看起来像
需要'zurb-foundation'
在此需要其他指南针插件。
部署时将其设置为项目的根目录:
http_path = /
css_dir =样式表
sass_dir = sass
images_dir =图像
javascripts_dir = javascripts
您可以在此处选择您喜欢的输出样式(可以通过命令行覆盖):
output_style = :expanded或:nested或:compact或:compressed
通过罗盘辅助功能启用资产的相对路径。取消注释:
relative_assets = true
在与sinatra的项目中出现相同的错误。它是从Foundation 3.2.5升级到版本4.0.2之后的。
我意识到‘foundation / common / ratios’不再是zurb-foundation的宝藏。
我在找不到基础或不可读基础时遇到了另一个错误,因此我还必须修改我的Gemfile,要求在zurb-foundation之前使用 compass gem。
宝石'罗盘'
宝石'zurb基金会'
在Gemfile中,无需使用基金会3.2.5的罗盘,但是现在有了,如果您查看zurb-foundation.rb代码(在您的ruby gemset中),您会看到:
如果已定义?(指南针)
Compass :: Frameworks.register( foundation,
:stylesheets_directory => File.join (root, scss),
:templates_directory => File.join(root, templates)
)
end
因此,如果在zurb-foundation之前未在项目指南针中定义,则zurb-foundation.rb不会扩展包括scss文件夹的路径。 p>
我希望我今天的经历能对您有所帮助。
最好的问候,
罗伯托
I have foundation installed and when I edit and save the app.scss file it creates a "app.css" and a "config.rb" file in the sass folder of my project. when I open that "app.css" file I get this
Syntax error: File to import not found or unreadable: foundation/common/ratios.
and then under that I get this:
File to import not found or unreadable: foundation/common/ratios.
Load paths:
/Applications/MAMP/htdocs/WebApp02/sass
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/blueprint/stylesheets
/Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets
Compass::SpriteImporter
on line 1 of /Applications/MAMP/htdocs/WebApp02/sass/_settings.scss
from line 2 of /Applications/MAMP/htdocs/WebApp02/sass/app.scss
and then a bunch of paths to my gems.
It never created an app.css and config.rb file in my sass folder before I was wondering if anyone can explain why that is happening. Compass still complies to app.css in the "stylesheet" folder but I would like to fix this to keep from any future errors from happening.
config.rb file looks like this
require 'zurb-foundation'
Require any additional compass plugins here.
Set this to the root of your project when deployed:
http_path = "/"
css_dir = "stylesheets"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"
You can select your preferred output style here (can be overridden via the command line):
output_style = :expanded or :nested or :compact or :compressed
To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = true
I was having same error in my project with sinatra. It was after upgrading from foundation 3.2.5 to version 4.0.2.I realized that 'foundation/common/ratios' is not in the zurb-foundation gem anymore.I had another error on "foundation not found or unreadable" so I had to modify also my Gemfile requiring 'compass' gem before zurb-foundation
gem 'compass'
gem 'zurb-foundation'
With foundation 3.2.5 'compass' wasn't explicitly required in Gemfile, but now it is and if you look at the zurb-foundation.rb code (in your ruby gemset), you can see:
if defined?(Compass)
Compass::Frameworks.register("foundation",
:stylesheets_directory => File.join(root,"scss"),
:templates_directory => File.join(root,"templates")
)
end
For this reason if in the project compass is not defined before zurb-foundation, zurb-foundation.rb doesn't expand the path including the scss folder.
I hope that my experience of today, may help you.Best regards, Roberto
这篇关于语法错误:找不到导入文件或不可读:Foundation / common / ratios的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!