export APP_NAME="something"
docker run -v "$PWD:/app" -w "/app" -e APP_NAME --entrypoint="/bin/bash" --rm ruby:3.3.0-slim -c 'apt-get update -qq && apt-get install -y git build-essential && gem install rails && rails new $APP_NAME'
- Ruby version: 3.3.0 (slim image)
- You can pick another version or image from the Ruby Docker Hub page