Rails 2024 brain dump
Still building tons of Rails apps, though the stack has evolved over time. Here are a few tidbits for the sub:
- All projects use justfile now. Never going back. We love that thing.
- Capistrano works great. Tried docker many times, it's just so slow and annoying...
- asdf! Might switch to mise, though.
- Common pattern is Rails API with Vue frontend (via vite ruby). Very happy with that combo. js-from-routes helpful too.
- Still love haml. We use it heavily for admin and mailers. Definitely out of vogue, though.
- Tailwind+Daisy is a great place to start.
- 100% typescript for the frontend. We avoid JS like the plague.
- Secrets stored using rails creds, one per env. We also have a bin script that deploys /etc/environment to each machine using the same technique (local file encrypted with master.key).
- Bigger apps use ansible. Smaller apps use a bash script.
- nginx/pg/sqlite/redis. Sometimes memcache, though often just redis.
- I love deploying behind cloudflare. Free SSL and CDN!
- Dev environments setup via bash script, leaning heavily on brew and asdf.
- 1password for the team
- Shoutout to figma and excalidraw
- ruby-lsp is really good at formatting with rubocop now. Thanks Shopify, your work is appreciated!
A decent sized Rails app can easily run on a $10 VPS these days, with fast deploys and zero downtime. For reference, I also have some experience with netlify/vercel, supabase, python, react/svelte, go, Cloudflare, AWS/GCP, rails ujs, edge functions, prisma, bootstrap... We've used everything, I guess. Rails is just so productive and powerful.
Haven't really used hotwire/stimulus yet. Vue is fun and we haven't felt the desire.
Unfortunately, still not getting much value out of Ruby type systems (sorbet, etc). I wonder how long Ruby can continue to thrive without types. Sometimes I dread returning to Ruby after a day or two writing Typescript in vscode. Javascript/typescript are crappy languages, but the tooling makes up for it.
Curious what other people are doing?
Edit1: Since a few people inquired, here is a lightly edited version of our justfile. May have typos, watch out: https://gist.github.com/gurgeous/a1d644ea54d60c687339e3cd9392ea50
Edit2: Coincidental Justfile thread on HN today for those who are curious: https://news.ycombinator.com/item?id=42351101
This comment in particular resonated with me: https://news.ycombinator.com/item?id=42351858