I have an Octopress blog that I host on Heroku using jgarber's custom buildpack. I had things working fairly well as long as I stuck with rdiscount
, but I recently decided to switch to kramdown
for the MultiMarkdown support. That's when things got weird.
This works fine on my local box (OS X), but when I push to Heroku, I get the following error:
Liquid Exception: incompatible character encodings: UTF-8 and ASCII-8BIT in atom.xml
So far as I can tell, I'm UTF-8 through and through, but I'll readily admit that Ruby isn't my normal stack, so maybe I'm just missing something. I'm on kramdown
v0.14.2. When I use foreman run rake clean generate
, everything works, as does bundle exec rake clean generate
. However, when I push to Heroku (or run heroku run rake clean generate
), I get the error above.
I thought the issue might be something to do with the default encodings, so I performed the following experiment:
$ irb
1.9.3-p327 :001 > ENV["LANG"]
=> "en_US.UTF-8"
1.9.3-p327 :002 > Encoding.default_external
=> #<Encoding:UTF-8>
and
$ heroku run irb
Running `irb` attached to terminal... up, run.6846
irb(main):001:0> ENV["LANG"]
=> "en_US.UTF-8"
irb(main):002:0> Encoding.default_external
=> #<Encoding:UTF-8>
At this point, I'm all out of ideas.