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.
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
.
I found that I was using a different ruby version on my heroku stack than on my devel machine. Transfered stacks and it worked.
精彩评论