views:

427

answers:

1

I'm writing a Django project that uses the LESS language. I'm using the django-css application to do this. My colleague is getting the following error, but I am not. I suspect that this might be because the encoding is wrong on the file being compiled. The weird thing is that we cloned from the same hg repo so I don't see why his files' encoding would be wrong and mine right.

TemplateSyntaxError at /qa/
Caught an exception while rendering: /home/rajoy/.gem/ruby/1.9.1/gems/less-1.2.21/lib/less/engine.rb:49:in `gsub': invalid byte sequence in UTF-8 (ArgumentError)
    from /home/rajoy/.gem/ruby/1.9.1/gems/less-1.2.21/lib/less/engine.rb:49:in `prepare'
    from /home/rajoy/.gem/ruby/1.9.1/gems/less-1.2.21/lib/less/engine.rb:30:in `parse'
    from /home/rajoy/.gem/ruby/1.9.1/gems/less-1.2.21/lib/less/engine.rb:45:in `to_css'
    from /home/rajoy/.gem/ruby/1.9.1/gems/less-1.2.21/lib/less/command.rb:58:in `parse'
    from /home/rajoy/.gem/ruby/1.9.1/gems/less-1.2.21/lib/less/command.rb:51:in `run!'
    from /home/rajoy/.gem/ruby/1.9.1/gems/less-1.2.21/bin/lessc:102:in `<top (required)>'
    from /var/lib/gems/1.9.1/bin/lessc:19:in `load'
    from /var/lib/gems/1.9.1/bin/lessc:19:in `<main>'

I have ruby 1.8.6 and gems 1.3.6.

My colleague has ruby 1.8.7 and gems 1.9.1.

What are the possible reasons for why this is happening?

+1  A: 

The Ruby version. The 1.9 changed the way String encodings are handled.

http://blog.grayproductions.net/articles/ruby_19s_string

Amadan
But he has ruby 1.8.7 not 1.9.
hekevintran
According to the error messages, he's using gems installed for Ruby 1.9.1. If he's using those with Ruby 1.8.7 that sounds like a bad idea and may very well be the cause of this problem.
Lars Haugseth