If you just need to have a minimal version of ruby on rails for your new project you are on the right page 🙂
Use this rails native command and have fun with your minimal setup:
rails new myapp --api --minimal
Just remember in this mode you don’t have frontend built-in functionalities.