指南针手表“ Errno :: EACCESS…权限被拒绝”

我只是将项目文件迁移到D:驱动器上的新PC上,而程序(Git,Node Js,Ruby等)却位于C:驱动器上。

我尝试compass watch在编辑SASS文件后运行,但是遇到此错误:

Errno::EACCES on line ["897"] of C: Permission denied - <D:/project_dir/stylesheets/app.css20140323-10532-gziux, D:/project_dir/stylesheets/app.css>
Run with --trace to see the full backtrace

我是Ruby命令行的新手(因为我仅将其用于Web开发)。我需要做什么才能允许这些权限?

如果可以提供更多信息,请告诉我。

编辑:这是运行后返回的内容compass watch --trace

D:\project_dir>compass watch --trace
>>> Change detected at 21:53:53 to: app.scss
overwrite stylesheets/app.css
Errno::EACCES on line ["897"] of C: Permission denied - (D:/project_dir/stylesheets/app.css20140323-14712-11v62k7, D:/project_dir/stylesheets/app.css)
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sass-3.2.18/lib/sass/util.rb:897:in `atomic_create_and_write_file'
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/lib/compass/actions.rb:58:in `write_file'
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/lib/compass/compiler.rb:143:in `compile'
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/lib/compass/compiler.rb:118:in `compile_if_required'
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/lib/compass/compiler.rb:103:in `block (2 levels) in run'
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/lib/compass/compiler.rb:101:in `each'
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/lib/compass/compiler.rb:101:in `block in run'
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/lib/compass/compiler.rb:126:in `timed'
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/lib/compass/compiler.rb:100:in `run'
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/lib/compass/commands/watch_project.rb:147:in `recompile'
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/lib/compass/commands/watch_project.rb:68:in `perform'
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/lib/compass/commands/base.rb:18:in `execute'
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/lib/compass/commands/project_base.rb:19:in `execute'
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/lib/compass/exec/sub_command_ui.rb:43:in `perform!'
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/lib/compass/exec/sub_command_ui.rb:15:in `run!'
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/bin/compass:30:in `block in <top (required)>'
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/bin/compass:44:in `call'
    C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/compass-0.12.4/bin/compass:44:in `<top (required)>'
    C:/Ruby200-x64/bin/compass:23:in `load'
    C:/Ruby200-x64/bin/compass:23:in `<main>'
>>> Compass is polling for changes. Press Ctrl-C to Stop.

I don't know what to make from that though.

From doing some reading (https://github.com/chriseppstein/compass/issues/1406) I believe it's something to do with the permissions or PATH for 'Ruby' & 'Ruby Gems' but I don't know what to do to resolve this.

西门2020/04/03 14:50:34

当我以管理员身份运行cygwin命令提示符窗口时,问题已为我解决。

西里Near2020/04/03 14:50:34

我遇到了类似的问题,可以通过卸载指南针和sass来解决此问题:

gem uninstall compass 
gem uninstall sass

然后,您需要做的就是安装指南针:

gem install compass

指南针安装过程中需要使用sass,因此不需要单独安装它。看来我面临的问题是作为指南针安装的一部分安装的版本与我手动安装的版本之间存在冲突。

达蒙2020/04/03 14:50:34

卸载SASS: gem uninstall sass

卸载COMPASS: gem uninstall compass

安装--pre COMPASS版本: gem install compass --pre

安装--pre SASS版本: gem install sass --pre

卡卡西Davaid2020/04/03 14:50:34

看起来问题已在SASS 3.2.19中解决

所以你只需要 gem update compass

伽罗理查德2020/04/03 14:50:34

我遇到了类似的错误,但是解决方案却完全不同,所以我认为值得分享,以防其他人遇到我的情况。

实际上,我被拒绝权限是因为我的源代码控制使我的.css文件变为只读文件。解决方案非常简单,只需签出css文件,一切便恢复正常。

SamJinJin2020/04/03 14:50:34

它看起来像最新版本的Sass中的错误。

卸载Sass和Compass并安装旧版本可解决此问题。

可能会有更新的版本可以使用,但是这是我已经测试并知道可以使用的版本。

gem uninstall compass
gem uninstall sass

gem install compass -v "0.12.2"
gem install sass -v "3.2.13"
Mandy村村2020/04/03 14:50:34

我有同样的问题。我做了建议-用--pre卸载并安装,但是并不能解决我的问题。之后,我遇到了另一个问题。好吧,我当时要做的是:我再次卸载了指南针和无礼的宝石。我删除了ruby / gems / ruby​​1.9.1 / gems文件夹中的所有与罗盘相关的宝石(可能没有必要,不确定),然后我安装了:gem install guide --version“ 0.12.2”和gem install sass-版本“ 3.2.10”。我认为这里的版本不是太重要,只要它不是这两个的最新版本即可。现在,这里重要的一点是:gem uninstall sass。它将询问您要擦除哪个版本,或者是否全部删除。删除较新的。这里的技巧是指南针会自动安装最新版本的sass。因此,如果您安装的是较旧的指南针,则没关系,因为已经有使用指南针的较新的指南针了。尝试一下。

Gil2020/04/03 14:50:34

为了使其能够在32位或64位Windows中工作,我按照Min Ren的建议进行了工作,但是C:\Users\myusername\.gem\specs\rubygems.org%443\quick\Marshal.4.8在卸载步骤之后,我还必须手动清理所有sass和指南针gemspec文件的gem库()。我还在指南针之前安装了sass。

gem uninstall compass
gem uninstall sass

手动清理.gem

gem install sass --version "3.2.10"
gem install compass --version "0.12.2"