Rails beginner
Rails beginner

Reputation: 14504

Rails invalid multibyte char (US-ASCII) - Heroku crash

My app is crashing on Heroku, here is the log:

pp/helpers/application_helper(bg).rb:70: invalid multibyte char (US-ASCII) (Synt
axError)
←[36m2011-09-15T18:48:44+00:00 app[web.1]:←[0m /app/app/helpers/application_help
er(bg).rb:71: invalid multibyte char (US-ASCII)

A part of the application helper(bg):

def convert_html_entities(text)
    text.gsub(/å/,"å") - Line 70
    text.gsub(/æ/,"æ")
    text.gsub(/ø/,"ø")   
    text.gsub(/©/,"©")         
end 

I have tried to safe the helper file as UTF-8 and it did not work.

Upvotes: 3

Views: 1566

Answers (2)

vesters
vesters

Reputation: 3

I found that I was using a different ruby version on my heroku stack than on my devel machine. Transfered stacks and it worked.

Upvotes: 0

Paweł Obrok
Paweł Obrok

Reputation: 23164

You should have the line

 # -*- coding: utf-8 -*-

as the first line of your file. If the file is saved in a different encoding substitute that for utf-8.

Upvotes: 7

Related Questions