Open ksubileau opened 10 years ago
Your system is sending compass strings with different encodings?!
I'm just using cmd.exe to launch compass, freshly installed, on a french Windows. It seems that there was a similar issue in Vagrant, maybe a similar fix could be applied in our case : https://github.com/mitchellh/vagrant/issues/3937
I need your help to see how is best to fix this.
http://stackoverflow.com/questions/5908774/set-global-default-encoding-for-ruby-1-9
provides some ideas for how to set your encodings as environment variables.
I've also pushed a branch that may fix this, but it may also create other issue. Please test it: https://github.com/Compass/compass/tree/default_encodings
Unfortunately I'm not very comfortable with the ruby ecosystem yet, so maybe it would be better if someone else could also help us.
But I've tested your changes. I've directly patch the core.rb file and created the encoding.rb file into my compass installation, according to your commit. I've also added a "puts" at the end of the encoding.rb file to check that it was properly executed.
First I received an error uninitialized constant Sass
on the first line of encoding.rb. So I've commented the corresponding if statement. And finally it doesn't seem to fix the issue, as I still get the initial encoding compatibility error.
However I managed to partially fix the issue by remplacing the line 87 of the file actions.rb with the following :
def relativize(path)
path = File.expand_path(path).encode('filesystem')
if path.index(working_path+File::SEPARATOR) == 0
# [...]
This fix the error on line 88 of actions.rb, but I get the same error in an another place when I use compass through gulp :
Encoding::CompatibilityError on line ["136"] of C: incompatible character encodings: CP850 and Windows-1252
C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.1/lib/compass/sass_compiler.rb:136:in `stylesheet_name'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.1/lib/compass/sass_compiler.rb:132:in `corresponding_css_file'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.1/lib/compass/sass_compiler.rb:54:in `block in individual_files'
Here again, and maybe also at other places, we have to apply the same fix. But I also get another error when I use compass watch, but it seems to be related to sass and not compass :
[Listen warning]: Change block raise an execption: undefined method `ArgumentError' for Sass::Util:Module
Backtrace:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.4.4/lib/sass/util.rb:703:in `rescue in relative_path_from'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.4.4/lib/sass/util.rb:695:in `relative_path_from'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.4.4/lib/sass/plugin/compiler.rb:560:in `relative_to_pwd'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.4.4/lib/sass/plugin/compiler.rb:432:in `block in on_file_changed'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.4.4/lib/sass/plugin/compiler.rb:429:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.4.4/lib/sass/plugin/compiler.rb:429:in `on_file_changed'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.4.4/lib/sass/plugin/compiler.rb:328:in `block in watch'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.4.4/vendor/listen/lib/listen/listener.rb:252:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.4.4/vendor/listen/lib/listen/listener.rb:252:in `on_change'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.4.4/vendor/listen/lib/listen/listener.rb:290:in `block in initialize_adapter'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.4.4/vendor/listen/lib/listen/adapters/polling.rb:48:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.4.4/vendor/listen/lib/listen/adapters/polling.rb:48:in `poll_changed_directories'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sass-3.4.4/vendor/listen/lib/listen/adapter.rb:299:in `block in start_poller'
This is what I get, every time I use vagrant
:
C:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/runtime.rb:224:in `join': incompatible character encodings: CP852 and Windows-1250 (
Encoding::CompatibilityError)
from C:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/runtime.rb:224:in `setup_environment'
from C:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/runtime.rb:15:in `setup'
from C:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler.rb:127:in `setup'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/bin/vagrant:71:in `<main>'
I had similar problem with capistrano, but it was solved when I've updated Ruby from 2.0 to 2.1. Maybe it is the solution?
I'm currently using the version 1.9.1 of Ruby, as you can see in the traces of my previous posts. Indeed, I've seen several similar bug reports on different projects. But here I've tried with the version 2.1.3, and I get the exact same error :
C:\Kévin\photos.kevinsubileau.fr>compass compile --trace --force
Encoding::CompatibilityError on line ["88"] of C: incompatible character encodings: UTF-8 and Windows-1252
C:/Ruby/lib/ruby/gems/2.1.0/gems/compass-1.0.1/lib/compass/actions.rb:88:in `relativize'
C:/Ruby/lib/ruby/gems/2.1.0/gems/compass-1.0.1/lib/compass/sass_compiler.rb:91:in `when_updated_stylesheet'
C:/Ruby/lib/ruby/gems/2.1.0/gems/compass-1.0.1/lib/compass/sass_compiler.rb:35:in `block (2 levels) in initialize'
[...]
The only difference is that the last error on compass watch
I mentioned in my previous post seems to be fixed. As I said, this error didn't seem to be related to compass, and the pull request ruby/ruby#713 has probably fixed it.
So the problem seems to be the non-ASCII characters in the path name. I had a ß
in there. Renaming the folder fixed it for me.
which path name faltrock-abone?
I am using ruby 2.2.x and I am have de same issue, when i try to rum the command "grunt serve" for a foundation app with sass.
sass incompatible character encodings: Windows-1252 and UTF-8"
@rcipriani the path from which compass is run. For example C:\Kévin\photos.keinsubileau.fr\
has an é
in it.
Hi,
When I try to run compass (watch or compile) on Windows, I get an encoding compatibility error as detailed below. Unfortunately, I have an accent in my user profile folder, and I guess that it's the reason of this issue. Of course, I could move the source folder, but it would be even better if compass could handle this case :)