开发者

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

开发者 https://www.devze.com 2023-04-05 17:37 出处:网络
My app is crashing on Heroku, here is the log: pp/helpers/application_helper(bg).rb:70: invalid multibyte char (US-ASCII) (Synt

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消