Open huiyiqun opened 7 years ago
Hi, I need help.
@josh @tricknotes
Running into this same problem trying to build with jekyll-babel within an AWS Codebuild environment (same docker image). What @huiyiqun said seems right, would very much love a fix.
Added jekyll-babel package to jekyll on macOS, getting this exact same error, no resolution found yet. Any ideas?
It's possible that when I ran into this, I either wasn't using a Gemfile or I hadn't specified encoding in my Gemfile... I eventually ended up switching to gulp, but try adding to the top of your Gemfile: Encoding.default_external = Encoding::UTF_8
Seeing the same issue, but only on DigitalOcean, not on my local machine…
Environments:
ruby:2.3
I'm faced with an encoding issue when using
jekyll-babel
which depends onruby-babel-transpiler
:After hours of debuging, I find that the problem is at here:
It reads
babel.js
withFile.read
directly without any paramters, which return a string with encodingUS-ASCII
, while the correct encoding isUTF-8
indeed. Thenexecjs
treats the string as aUS-ASCII
encoded string and trys to transcode it toUTF-8
so it fails because of non-ASCII characters.The solution is to add a parameter to
File.read
according to the doc:I have little knowledge about ruby, please correct me if there are some mistakes.