【问题标题】:getting Errno::ENOENT: No such file or directory on sass watch command获取 Errno::ENOENT: No such file or directory on sass watch 命令
【发布时间】:2011-05-05 12:23:30
【问题描述】:

我在我的 Windows 系统上安装了 Ruby 以使用 Sass,以便在我的 PHP 项目中遵循 CSS 主题的最佳实践,如 Best Practices - CSS Theming 中给出的。我以前从未使用过 Ruby 或 Sass。

安装后我去Start Command Prompt with Ruby进入-

gem install sass

并且安装成功。

然后按照http://sass-lang.com/tutorial.html给出的教程,

我在我的 web 目录(PHP 开发环境)中的 /some/path 创建了两个文件 test.scsstest.css。我在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.

我该如何解决这个问题?任何指针?

谢谢

【问题讨论】:

    标签: ruby sass


    【解决方案1】:

    我建议你打开 cmd.然后给出你的 scss 文件所在文件夹的父文件夹的完整路径。然后输入“sass --watch Foldername:Foldername”然后回车。

    在您的情况下,它在 cmd 中应该看起来类似于:

    C:\xampp\htdocs\examvillage_recovered\branches\I18N\trunk\style>sass --watch dev_styles:dev_styles
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-06
      • 2016-01-13
      • 1970-01-01
      • 2022-01-06
      • 2021-11-01
      相关资源
      最近更新 更多