Here’s a PR with the requested changes.
https://github.com/discourse/discourse/pull/16641
I still couldn’t get it to run successfully, there was a java.lang.NullPointerException, but that might be just me crudely disabling mini_racer. I’m really looking forward to seeing a fully functional Discourse running on TruffleRuby.
I didn’t look into this any further, but I noticed an error when I only disabled loading of stackprof and memory_profiler. So I completely disabled mini_profiler for now.
2022-05-04 21:48:13 +0200 Rack app ("POST /mini-profiler-resources/results" - (127.0.0.1)): #<SystemStackError: stack level too deep
from StackOverflowCheckImpl.java:328:in `com.oracle.svm.core.graal.snippets.StackOverflowCheckImpl.newStackOverflowError0'>
It might have been a side effect of other problems. I guess we could investigate when other problems are solved.