Is your Discourse server running in a Docker container? If so you need to run bundle install inside the container.
bundle install