rake test and error : log writing failed. “\xE2” from ASCII-8BIT to UTF-8

前端 未结 3 780
旧时难觅i
旧时难觅i 2021-02-19 09:46

When I run rake test, I get error line every time.

log writing failed. \"\\xE2\" from ASCII-8BIT to UTF-8  

Please guide on this.

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-19 10:03

    In my case some weird quotation marks were the culprit so I just replaced them with the safe characters like this,

    msg = error.message.gsub(/[“”]/, "\"").gsub(/[‘’]/,"\'")
    

提交回复
热议问题