RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Submit a post

You can use basic HTML markup (e.g. <a>) or Markdown.
Note that your post may be edited to suit the format of the site.

As you are not logged in, you will be
directed via GitHub to signup or sign in

Post Preview

Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.

Today

Kill SSH on ECS: get a Rails console via ECS Exec with Terraform

Still keeping port 22 open and a key pair in your launch template just so someone can run rails console in staging? This guide walks through replacing SSH with AWS SSM Session Manager and ECS Exec using Terraform. It covers IAM for instance and task roles, VPC endpoints for private subnets, exec logging, rolling it out through CI, and the gotchas that eat the most time: tasks that predate enable_execute_command, log groups created by hand, and TargetNotConnectedException. It ends with a troubleshooting table and a checklist for production.

I've made a experimental 3d engine that uses mruby

I’ve been building a small 3D game engine using mruby: https://github.com/carlosdanielpohlod/redgem The engine is written in C++, but I wanted Ruby to be the main way to build games with it. It has physics, a 3D editor, Blender level import, and a few other things. It’s still a work in progress, and I used AI quite a lot to help build it. There’s definitely room for improvement, but I thought it would be interesting to share it with the mruby community. Read more

introducing runsheets, an executable runbook

runsheets is a Ruby gem that serves markdown runbooks as a local web page. Fenced code blocks you mark as runnable get a Run button. Every run is written to a “runsheet” (aka session log) that records each command exactly as it ran, its output, its exit status and timing, and each time the operator signs off on a manual step. Secret inputs are redacted from the output, and a destructive block won’t run until the operator types a confirmation code. runsheets --check lints a runbook, --new builds one from templates, and --run runs a single step from the terminal. It’s a proof of concept, and I’d like feedback from people who use runbooks every day. Install it with gem install runsheets (it needs Ruby 3.4 or newer), and see the docs for more.

Deploying a Rails 8 App to a VPS with Kamal 2: A Practical Guide

A start-to-finish walkthrough of shipping a Rails 8 app to a single VPS with Kamal 2, using Vite, Solid Queue, PostgreSQL as a Kamal accessory and Docker Hub. It focuses on the errors you will probably hit: a Dockerfile with no Node.js, a database.yml that falls back to localhost, SOLID_QUEUE_IN_PUMA=false turning the Puma plugin on, uncommitted changes that Kamal never builds, and Let’s Encrypt failing on DNS. It ends with what Kamal leaves to you: backups, HA and Postgres major upgrades. Read more

Shrinking a 130 GB Postgres to a Local Copy with Greenmask: What Worked and What Brok

Staging had grown past 130 GB, a full pg_dump was out of the question, seeds never reproduced real bugs, and the data was full of PII. This post walks through building a small, FK-consistent, masked subset of a Rails app’s Postgres with Greenmask. It covers virtual references for Rails associations that never got a database FK, and masking every user to user<ID>@example.test with a known dev password. It also goes through the six things that broke and how each was fixed: NULL-owner rows slipping through, a self-referencing FK that panics the planner, invalid SQL from polymorphic references, orphan rows, the source running out of temp space on a 70 GB table, and a PostGIS NOTICE that aborts the restore. The result is a repeatable pipeline: restore by section, run a repair pass before the FKs are created, then verify.

Don't bet on SELECT's order: shuffle your rows and see what folds

SELECT * FROM posts carries no promise about the order of the returned posts. Yet, every relational database hands them back in some order, and code and tests start depending on that order. You can’t grep for a bug like this, but you can smoke it out by deliberately shuffling the rows of every unordered query and seeing what fails. (Rails has since merged a switch of its own from Evil Martians, config.active_record.shuffle_unordered_selects, due in 8.2.) We also share pg_disorder, the open-source PostgreSQL extension we built to do the same thing at the database level. Read more

Brunch Gem: Isolated Development Environments for Git Branches and Worktrees

Brunch is a Ruby gem that gives Git branches and worktrees isolated development environments. Each branch can have its own containers, network, volumes, and persistent state, while each worktree gets its own host port. This makes it easier to switch between branches safely and to run multiple worktrees in parallel, including workflows driven by IDEs and coding agents. Read more

Loading older posts