Create new Rails project
11 March 2022 (Updated 11 February 2023)
Update Rails to latest version
gem update rails
Create project
With specific database
rails new myapp --database=<postgresql|mysql>
With specific database and CSS strategy
rails new myapp --database=postgresql --css=tailwind
As an API-only backend
rails new <name> --api --database=postgresql -T
As a very minimal API-only backend:
rails new <name> --api -T
-T
: skip tests
My current choice
rails new <name> --database=mysql --skip-test --c=tailwind
As a GraphQL back-end
rails new oolala-backend --database=mysql -T -J --skip-hotwire
Configure database
Edit config/database.yml
and set the correct database credentials.
Create database:
./bin/rails db:create
Setup project
Tagged:
Rails
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment