Accidentally installed ruby-railties

You should be just fine. You installed ruby-railties on the host operating system. Doing so won’t impact your Discourse install, though it may cause confusion in the future if you forget enter app again, as you might end up opening a rails console on the host, rather than in docker.

apt remove ruby-railties is safe to run - just make sure you’re not in the docker container.