Ruby on Rails RedCloth issue when using Docker on Apple M1 hardware

109 views Asked by At

When using the RedCloth gem under Ruby on Rails in a Docker container on an Apple M1 system, the string get truncated just before the first non-ascii character. The problem does not happen on an Apple Intel system or if Rails is run outside of Docker. This GitHub repo should reproduce the issue on any Apple M1 hardware:

https://github.com/mo-nathan/docker-test

I'm guessing it has something to do with how the standard ruby Docker images are getting created for Apple M1s. I've tried tracing the issue using a Ruby debugger, but haven't found any additional clues.

1

There are 1 answers

0
Markus Herzog On

I'm experiencing the same issue:

irb(main):015:0> RedCloth.new("abc def ghi äöü xyz").to_html # or .to_latex
=> "<p>abc def ghi</p>"

Only instead of inside a Docker container, this is in a virtual Debian Parallels box (also on an Apple M1 system)

It works perfectly with the ruby on the Apple host itself, btw.