0

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.

  • if it is a bug, might be a better idea to post it to the issues of the gem if indeed it is something that needs to be fixed by the maintainers - https://github.com/jgarber/redcloth/issues. – PressingOnAlways Jun 24 '22 at 01:58
  • Thanks! I've now posted this issue to the RedCloth GitHub issues page (https://github.com/jgarber/redcloth/issues/66) and to the Ruby Docker GitHub issues page (https://github.com/docker-library/ruby/issues/385). – Nathan Wilson Jun 24 '22 at 10:02

1 Answers1

0

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.

Markus Herzog
  • 374
  • 5
  • 9