Errno :: ENOENT:Sass Watch命令上没有这样的文件或目录
问题描述:
我在我的Windows系统上安装了Ruby以使用Sass
,以便遵循我的PHP项目中的CSS Theming中的最佳实践,如Best Practices - CSS Theming中给出的。我以前从未使用Ruby或Sass。Errno :: ENOENT:Sass Watch命令上没有这样的文件或目录
安装完毕后,我去Start Command Prompt with Ruby
,进入 -
gem install sass
,并成功安装。
然后按照http://sass-lang.com/tutorial.html给出的教程,
我创建了两个文件test.scss
和test.css
在/some/path
这是我的网页目录(PHP开发环境)内。我写在test.scss
以下 -
/* test.scss */
#navbar {
width: 80%;
height: 23px;
}
我在Ruby命令提示符cd'ed到/some/path
和进入 -
sass --watch test.scss:test.css
而得到这个输出 -
Sass is watching for changes. Press Ctrl-C to stop.
Errno::ENOENT: No such file or directory - test.scss
Use --trace for backtrace
的错误即使我给出的CSS文件的整个绝对路径。如果我添加--trace的命令,以下为输出 -
C:/Ruby192/lib/ruby/gems/1.9.1/gems/sass-3.1.1/lib/sass/plugin/compiler.rb:317:i
n `read': No such file or directory - C:\xampp\htdocs\examvillage_recovered\bran
ches\I18N\trunk\style\dev_styles\test.scss (Errno::ENOENT)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sass-3.1.1/lib/sass/plugin/comp
iler.rb:317:in `update_stylesheet'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sass-3.1.1/lib/sass/plugin/comp
iler.rb:169:in `block in update_stylesheets'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sass-3.1.1/lib/sass/plugin/comp
iler.rb:167:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sass-3.1.1/lib/sass/plugin/comp
iler.rb:167:in `update_stylesheets'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sass-3.1.1/lib/sass/plugin/comp
iler.rb:214:in `watch'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sass-3.1.1/lib/sass/plugin.rb:1
11:in `method_missing'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sass-3.1.1/lib/sass/exec.rb:408
:in `watch_or_update'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sass-3.1.1/lib/sass/exec.rb:294
:in `process_result'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sass-3.1.1/lib/sass/exec.rb:41:
in `parse'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sass-3.1.1/lib/sass/exec.rb:21:
in `parse!'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sass-3.1.1/bin/sass:8:in `<top
(required)>'
from C:/Ruby192/bin/sass:19:in `load'
from C:/Ruby192/bin/sass:19:in `<main>'
然后通过这个YouTube视频http://www.youtube.com/watch?v=b_-HLevIJbc在安装步骤提去。我也安装了gem haml
,并且安装成功。
但我仍然得到这个错误有一个额外的通知
NOTE: Gem::Specification#default_executable= is deprecated with no replacement.
It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from C:/Ruby192/lib/ruby/gems/1.9
1/specifications/rubygems-update-1.8.0.gemspec:11.
>>> Sass is watching for changes. Press Ctrl-C to stop.
Errno::ENOENT: No such file or directory - C:\xampp\htdocs\examvillage_recovere
\branches\I18N\trunk\style\dev_styles\test.scss
Use --trace for backtrace.
我该如何解决这个问题?任何指针?
谢谢
答
我建议你打开cmd。然后给出scss文件所在文件夹的父文件夹的完整路径。然后输入“sass --watch Foldername:Foldername”,然后按回车。
在你的情况下,它应该与此类似在cmd:
C:\xampp\htdocs\examvillage_recovered\branches\I18N\trunk\style>sass --watch dev_styles:dev_styles