Set up a new Ruby on Rails project
Written by
Juan Gallardo
Published
Last updated
Table of Contents
Article 1 in [Series: Build a blog with Ruby on Rails] Next: Phlex components
1. The rails new
command
Let’s omit a few features we might never need.
1
2
3
4
5
6
7
8
9
rails new xolux \
--name=app \
--database=postgresql \
--edge \
--css=postcss
--skip-docker --skip-kamal \
--skip-action-mailer --skip-action-mailbox \
--skip-test --skip-system-test \
--skip-ci \
Explanation:
xolux
Use your preferred root folder name--name=app
We are setting the application name to “App”. This will allow us to copy and paste stuff around in the future. Our Rails apps live in their own servers, so there’s no risk of service name collisions.--database=postgresql
We are using PostgreSQL in production, so might as well use it in development as well--edge
Let’s use the latest features in Ruby on Rails 8.0--css=postcss
Let’s build an awesome PostCSS pipeline so we can cherry-pick our favorite tools [TO DO: Write a CSS guide and link here]--skip-docker
,--skip-kamal
We are deploying to Render via blueprint [TO DO: Write a deployment guide and link here] and so we only need to point Render to our GitHub repo, rather than building our own Docker container--skip-action-mailer
,--skip-action-mailbox
We are using SMTP2GO’s API [TO DO: Write SMTP2GO guide and link here] rather than the built-in emailing library--skip-test
,--skip-system-test
I’m omitting testing here not because it isn’t important but because I don’t know the first thing about testing. Ok, everybody has to start somewhere!--skip-ci
No need to clutter our directory with these files until we’re ready to add CI. And we may not ever need to
2. Don’t commit your IDE files to VCS
# /.gitignore
# Ignore NetBrains IDE config files
.idea/
3. Set up a database
Run ./bin/setup
to set up the development database