當我編譯我的SCSS時,出現一個「找不到文件」的錯誤,導致我相信我的config.rb有問題。在命令行的誤差包括路徑的一部分的兩倍,以及所述「..」相對目錄:未找到或無法讀取SASS/config.rb中的指南針路徑導致編譯時出現問題
文件: C:/ REALLY_LONG_PATH/C:/ REALLY_LONG_PATH/.. /img/avatar.jpg
的config.rb內容如下:
:如果我省略引用它在SCSS文件中的CSS# Delineate the directory for our SASS/SCSS files (this directory)
sass_path = File.dirname(__FILE__)
# Delineate the CSS directory (under resources/css in this demo)
css_path = File.join(sass_path, "..", "css")
# Delinate the images directory
images_dir = File.join(sass_path, "..", "img")
# Load the sencha-touch framework
load File.join(sass_path, '..', 'js', 'sencha', 'resources', 'themes')
# Specify the output style/environment
output_style = :expanded
environment = :production
此錯誤是不存在
background-image: inline-image('avatar.jpg');
但考慮到我想實際使用圖像這一事實,這對我造成了一個問題。任何幫助將是肉汁。
編輯:另一件值得注意的事實是,我的CSS似乎在適當的目錄中使用與img路徑相同的格式呈現得很好。
爲什麼你有一個真正的長路徑名? –
爲了說明而縮短。這不是一些路徑變量或其他東西。感謝您的檢查。 –
我不知道這是一個Windows/Ruby的東西......如果你明白路徑是如何工作的,你可以嘗試使用絕對路徑而不是相對路徑嗎? –