2013-02-27 55 views
11

我安裝了基礎,當我編輯並保存app.scss文件時,它會創建一個「app.css」和一個「config.rb」文件在我的項目的sass文件夾中。當我打開「app.css」文件,我得到這個語法錯誤:導入未找到或無法讀取的文件:foundation/common/ratios

Syntax error: File to import not found or unreadable: foundation/common/ratios. 

,然後根據我得到這個:

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 

,然後一堆路徑我的寶石。

在我想知道是否有人能解釋爲什麼會發生這種情況之前,它從未在我的sass文件夾中創建app.css和config.rb文件。指南針仍然符合「樣式表」文件夾中的app.css,但我想解決這個問題以防止將來發生任何錯誤。

config.rb文件看起來像在我與西納特拉項目這個

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 
+0

你的config.rb是什麼樣的? – cimmanon 2013-02-28 03:00:09

+0

我將config.rb內容添加到原始問題 – 2013-02-28 16:51:24

回答

8

我有同樣的錯誤。它是從基礎3.2.5升級到4.0.2版之後的。 我意識到'foundation/common/ratios'不在zurb-foundation gem中了。 我已經在另一個錯誤「的基礎找不到或無法讀取」,所以我不得不之前zurb-基礎

gem 'compass' 
gem 'zurb-foundation' 

隨着基礎3.2.5「指南針」還修改我的Gemfile要求「指南針」寶玉沒有明確要求在Gemfile中,但現在是,如果你看一下zurb-foundation.rb代碼(在你的紅寶石寶石),你可以看到:

if defined?(Compass) 
    Compass::Frameworks.register("foundation", 
    :stylesheets_directory => File.join(root,"scss"), 
    :templates_directory => File.join(root,"templates") 
) 
end 

出於這個原因,如果在項目羅盤zurb之前沒有定義-foundation,zurb-foundation.rb不會擴展包含scss文件夾的路徑。

我希望今天的經驗能幫助你。 最好的問候, 羅伯託

+0

,非常感謝您! – 2013-03-05 15:06:34

+2

因爲'基礎/共同/比率'不再是zurb-foundation gem了......我該如何處理這個問題,我有同樣的問題。我從Foundation和Overrides文件中刪除了'foundation/common/ratios'導入語句,但是現在我的一些樣式沒有正確應用。 – 2013-03-09 13:18:35

+0

或compass-rails,如果您在導軌應用程序中出現此錯誤 – Will 2013-06-22 09:02:51

4

我不能得到這個工作(軌道3.2.12與資產管道和寶石「指南針軌」和/或寶石「指南針」),所以我只是鎖定在3.2.5

gem 'zurb-foundation', "= 3.2.5" 
0

我在嘗試使用visual studio更新基金會3網站時出現了相同的錯誤Express 2010. Express不允許使用Mindscape擴展工具。

所以這是我現在幾次工作。我基本上開始使用指南針來創建文件夾的新webfolder。我不會浪費時間嘗試更新,因爲這似乎對我有用。無論如何,它都是在版本更新之前備份的。

從您的網站上方的根文件夾。 (我用的是VS默認路徑),這樣在命令行中軌我cd到這個路徑

> cd C:\Users\georgegargoyle\Documents\Visual Studio 2010\WebSites\ 

*注意:如果你是從基礎3 ungrading,你只使用基礎紅寶石,你很好可以有這是新基金會需要的舊版本。我已經不知道它傷害到剛剛卸載並重新安裝青菜

這是

> gem uninstall sass 
> 
> gem install sass 

我想,如果它要求你青菜的版本,你不知道 型5號選項爲文本不是編號5 ...所有版本? 然後..鍵入數字5 你可能會得到兩個警告,所以我只是打了Y或是兩次。

無論如何,從網站的文件夾類型

指南針創建yournewfolder -r zurb-基礎--using基礎

你應該看到酷活泉!它就在那裏,然後

> cd yournewfolder 

移動到項目文件夾,然後

gem install compass 
gem update compass 
gem install foundation 
gem update foundation 

爲基礎的文檔下方,我是新來這個所以這不一定是最好的做法,正是爲我工作。感謝上面的gekorob,我想我學到了,我懷疑,由於你安裝的版本,你運行這些命令的順序很重要。紅寶石,指南針,sass,基礎和視覺工作室。

我懷疑可能會導致問題,如果認爲切換。並會帶你到這裏。

http://foundation.zurb.com/docs/sass.html

希望這有助於和你看到很多這一點。

http://www.ipaad.org/images/Step105.jpg

相關問題