Start a new Rails App (v8)
With Tailwind
Create the new app
use these options for:
postgres database
tailwindcss
not using Kamal for deployments
skip-ciwill skip installing the.githubfolder, which has a CI deployment workflow
rails new projectname --database=postgresql --css=tailwind --skip-kamal --skip-ci If I don't plan on using any of the solid stuff (solid_cache, solid_cable, solid_queue then add --skip-solid
CD to the new app
cd projectnameCreate the database
rails db:createConnect to database in TablePlus app
host: localhost
username: briancasel
password: emma
database_name: Find this in config/database.yml. It's probably projectname_development
port: 5432
Create the GitHub repo
Go to https://github.com/new and create a new Repo.
Copy/paste all lines provided there to initialize git and push to this new repo on GitHub
Setup staging & production environments & create credentials
Create
config/environments/staging.rband copy all of the contents fromproduction.rbinto it.Create credentials by running my terminal aliases:
developmentcredentialsstagingcredentialsproductioncredentialstestcredentials
Add config for tailwindcss to work
The following must be added to both production.rb and staging.rb in order for tailwindcss to work when deployed anywhere:
# Compress CSS using a preprocessor.
# IMPORTANT FOR TAILWINDCSS: Set this to nil, to ensure assets can compile when deployed.
# Solution found here: https://github.com/tailwindlabs/tailwindcss/discussions/6738#discussioncomment-2010199
config.assets.css_compressor = nilSet up background processing
See my notes on using Solid Queue
See my notes on installing SideKiq
Start Rails Server
./bin/devThe app should now be viewable at http://127.0.0.1:3000
Last updated