"Errno :: EACCESS ... permission denied" performing a compass scan

I just transferred my project files to a new computer on the D: drive, while my programs (Git, Node Js, Ruby, etc.) are on the C: drive.

I tried to run compass watch after editing the SASS file, but ran into this error:

 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 

I start with Ruby on the command line (since I use it only for web development purposes). What do I need to do to allow permissions?

Please let me know if I can provide more information.

EDIT: This is what was returned after running 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 do not know what to make of this.

From some reading ( https://github.com/chriseppstein/compass/issues/1406 ) I believe this is due to permissions or PATH for 'Ruby' and 'Ruby Gems' , but I don’t know what to do to allow this is.

+13
windows ruby sass compass-sass
Mar 23 '14 at 21:21
source share
9 answers

To make it work in 32 or 64-bit windows, I did what Min Ren suggested, but I also had to manually clear the gem repository ( C:\Users\myusername\.gem\specs\rubygems.org%443\quick\Marshal.4.8 ) of all sass and compass gemspec files after the removal steps. I also installed sass in front of the compass.

 gem uninstall compass gem uninstall sass 

manually clear .gem

 gem install sass --version "3.2.10" gem install compass --version "0.12.2" 
+36
Mar 25 '14 at 15:34
source share

I had the same problem for a while, and it was eventually fixed manually. After some digging, the problem is that in util.rb the temporary file is renamed until the file is closed. On Windows, this is apparently not allowed (although I don’t know why I suddenly started getting the problem after he worked on the past).

The fix for me was to edit the .rb utility (PATH_TO_RUBY \ lib \ ruby ​​\ gems \ 1.9.1 \ gems \ sass-3.2.18 \ lib \ sass \ util.rb). I copied the line that closes the temporary file before changing the permission + rename it at line 897. Here is the updated function, since I now have:

 def atomic_create_and_write_file(filename, perms = 0666) require 'tempfile' tmpfile = Tempfile.new(File.basename(filename), File.dirname(filename)) tmpfile.binmode if tmpfile.respond_to?(:binmode) result = yield tmpfile tmpfile.flush # ensure all writes are flushed to the OS begin tmpfile.fsync # ensure all buffered data in the OS is sync'd to disk. rescue NotImplementedError # Not all OSes support fsync end tmpfile.close if tmpfile # Make file readable and writeable to all but respect umask (usually 022). File.chmod(perms & ~File.umask, tmpfile.path) File.rename tmpfile.path, filename result ensure # close and remove the tempfile if it still exists, # presumably due to an error during write tmpfile.close if tmpfile tmpfile.unlink if tmpfile end 

One big caveat here is that I am not a Ruby man, and I am sure that probably the best way. But I just tried this mod quickly and it worked, so I no longer invested in it.

+9
Mar 24 '14 at 15:59
source share

It looks like a bug in the newest version of Sass.

Removing Sass and Compass and installing older versions fixes the problem.

There may be newer versions that really work, but here is what I tested and know that works.

 gem uninstall compass gem uninstall sass gem install compass -v "0.12.2" gem install sass -v "3.2.13" 
+4
Mar 24 '14 at 8:29
source share

It looks like the problem is resolved in SASS 3.2.19

so all you need is a gem update compass

+4
Apr 28 '14 at 10:05
source share

I was getting a similar error, but had a completely different resolution, so I thought it was worth sharing that someone else was encountering my script.

I really got permission because my original control made my .css files read-only. The solution was quite simple, just check the css files and everything returned to normal.

+3
Oct 08 '15 at 3:04 on
source share

I had the same problem. I made a suggestion - uninstall and install using --pre, however this did not solve my problem. After that, I ran into other problems. Well, then I did the following: I again deleted the compass and sassis. I removed all the compass-related gems in the ruby ​​/gems/ruby1.9.1/gems folder (which is probably not necessary, not necessary), and I installed: gem install compass --version "0.12.2" and gem install sass - version "3.2.10". I do not think the versions here are too important, as long as these are not the latest versions of the two. Now the important bit is here: gem uninstall sass. He will ask you which version will be destroyed or all of them. Remove the new one. The trick here is that the compass automatically installs a new version of sass. Therefore, if you install an older one, it does not matter, since there is already a newer one with a compass to be used. Give it a try.

+1
Mar 24 '14 at 16:01
source share

Remove SASS: gem uninstall sass

Uninstall COMPASS: gem uninstall compass

Install the --pre COMPASS version: gem install compass --pre

Install the --pre SASS version: gem install sass --pre

0
Mar 24 '14 at 11:55
source share

I had a similar problem and I was able to solve it by removing both compass and sass:

 gem uninstall compass gem uninstall sass 

Then all you have to do is install the compass:

 gem install compass 

sass is required as part of compass installation, so you do not need to install it separately. It seems that the problem I was facing was that there was a conflict between the version installed as part of the compass installation and the one that I installed manually.

0
Apr 7 '14 at 9:32
source share

The problem was resolved for me when I ran the cygwin command prompt window as an administrator.

0
Apr 14 '16 at 9:21
source share



All Articles