简体   繁体   English

没有“ sudo罗盘手表”,指南针将无法编译

[英]Compass won't compile without “sudo compass watch”

The Scenario 场景

I'm switching from Codekit to the command line and have run into a weird issue. 我从Codekit切换到命令行,遇到了一个奇怪的问题。 Anytime I want compass to watch a directory by entering compass watch , I get this strange error: 每当我想通过输入compass watch使compass watch目录时,都会出现此奇怪的错误:

Errno::EACCES on line ["1144"] of /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb: Permission denied - /Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.0.alpha.19/stylesheets/.listen_test

After some testing, I found out that if I enter sudo compass watch , the error does not appear, and compass compiles like a beaut. 经过一些测试,我发现如果我输入sudo compass watch ,则不会出现错误,并且指南针会像漂亮的姑娘一样进行编译。

The problem must be with my permissions. 问题必须出在我的许可下。 Sudo gives root level access to the system, and by having to use a sudo command, I can tell that my permissions must be wonky. Sudo授予了对系统的root级访问权限,并且通过使用sudo命令,我可以知道我的权限必须是虚假的。

The real question is, what's the fix? 真正的问题是, 解决方法什么?

Thanks! 谢谢!

A quick way to avoid sudo which worked for me after encountering the same issue was to go to the directory 避免在遇到相同问题后对我sudo一种快速方法是转到目录

/Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.0.alpha.19/

and give yourself read/write access on that folder and all enclosed folders. 并授予您对该文件夹和所有随附文件夹的读/写访问权限。 Assuming you're on a Mac since you were using CodeKit, select the folder and hit cmd+i then hit + near the bottom of the window to add yourself (if not already listed). 假设您使用的是CodeKit,因为您使用的是Mac,请选择该文件夹并单击cmd+i然后单击窗口底部附近的+以添加您自己(如果尚未列出)。 Enable Read & Write access. 启用读写访问权限。 Finally, hit the gear icon and select Apply to enclosed items 最后,点击齿轮图标,然后选择“ Apply to enclosed items

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM