Structured logging in Rails 8.1 with Rails.event ruby-on-rails

Structured logging in Rails 8.1 with Rails.event

Structured logging lands in Rails 8.1 with the Rails.event API. How the Structured Event Reporter replaces regex-parsed log lines with JSON events, plus tags, context, schemas, debug mode, and how to subscribe and test events in your own app.

Mar 16, 2026

Ruby 4.0 - a big update for its 30th birthday

Ruby 4.0 - a big update for its 30th birthday

Ruby 4.0 marks the language's 30th birthday with maturity instead of revolution: saner syntax for multiline conditions, faster boot with fewer requires, a maturing Ractor story, hidden performance gems, and protection against command injection.

Powerful switch statement with pattern matching in Ruby

Powerful switch statement with pattern matching in Ruby

Pattern matching in Ruby turns case statements into a precise switch over data shapes: match and destructure hashes from an API response, combine several patterns in one branch, capture values across patterns, and validate configuration. Ruby 2.7+ syntax examples.

Multiple ways to execute a shell command via Ruby

Multiple ways to execute a shell command via Ruby

Running shell commands from Ruby: system, backticks, exec, the IO class, spawn, and Open3.popen3 compared with pros and cons, from quick one-liners to capturing stdout, stderr, and exit status, so you can pick the right method for scripts and production code.

Database shrading and database partitioning in Rails

Database shrading and database partitioning in Rails

Database sharding in Rails step by step: create a separate database per shard, wire them up in database.yml, and query across them. Plus how sharding differs from partitioning, with a native PostgreSQL partitioning example done through Rails migrations.

Ruby in browser via WebAssembly

Ruby in browser via WebAssembly

Ruby 3.2 runs in the browser through WebAssembly: embed Ruby in a script tag with ruby-wasm-wasi or drive the Ruby VM from JavaScript and mix it with HTML. Working examples plus honest limits: no threading or networking, and no extra gems without a custom wasm image.