---
title: "Can AI tools write good Rails code? Well.."
publication: "Ruby Weekly"
issue: 661
published_at: "2023-07-06"
canonical_url: "https://rubyweekly.com/issues/661"
---

Plus let's get a grip on pattern matching, RBS, and garbage collection. |        

#​661 — July 6, 2023 

[Read on the Web](https://rubyweekly.com/issues/661)  

Together with [![Memetria\](https://res.cloudinary.com/cpress/image/upload/c_fill,g_auto,w_600,h_145/e_make_transparent/co_white,e_outline:7/vvpdctzacmq3xehpvwps.png)](https://dashboard.memetria.com/rubyweekly/)   

Ruby Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/uon6zqmjy2itpswixd5d.jpg)](https://blog.peterzhu.ca/notes-on-ruby-gc/)  

[Revisiting Garbage Collection in Ruby](https://blog.peterzhu.ca/notes-on-ruby-gc/) — First published in 2020 but now almost entirely rewritten for 2023, Ruby internals expert Peter Zhu takes us on a technical, but reasonably easy to follow, tour through Ruby 3.2’s GC implementation, its data structures, and how the phases of its lifecycle operate. 

Peter Zhu   

[Deploying Rails Apps with Dokku](https://railsnotes.xyz/blog/deploying-ruby-on-rails-with-dokku-redis-sidekiq-arm-docker-hetzner) — If you like the convenience of platforms like Heroku but want to run things on your own server, [Dokku](https://dokku.com/) is a mature, open-source PaaS worth trying. The author has _“tried to put together the ultimate Dokku + Ruby on Rails guide”_ and has done a good job IMHO, including adding Redis, Sidekiq, and deploying to ARM-based servers with Docker. (_Much of it can be adapted to non-Rails apps, too_.) 

Harrison Broadbent   [![\](https://copm.s3.amazonaws.com/5ec8e117.png)](https://dashboard.memetria.com/rubyweekly/) 

[Memetria: Secure, Scalable Redis 7 Hosting](https://dashboard.memetria.com/rubyweekly/) — High performance Redis hosting with large key tracking, detailed metrics, and a superior uptime record. 

Memetria sponsor    

[Pattern Matching on Ruby Objects](https://fly.io/ruby-dispatch/pattern-matching-on-ruby-objects/) — Introduced experimentally in Ruby 2.7 and becoming more established in Ruby 3.x, [pattern matching](https://docs.ruby-lang.org/en/master/syntax/pattern_matching_rdoc.html) is one of Ruby’s most intriguing syntax additions in recent years. It allows you to deeply match against values in structures and other objects and to do so depending on the _shape_ of said objects.. 

Brad Gessler   

🎙️ JRuby's co-lead developer, Charles Nutter, was recently [interviewed about the state of JRuby](https://www.hostingadvice.com/blog/jruby-implements-the-ruby-language-atop-the-jvm/), how it survived the pandemic, and its CRuby-compatibility story. 

🇯🇵 [Kaigi on Rails 2023](https://kaigionrails.org/2023/) is a Japanese language Rails event taking place both online and offline (in Tokyo) this October. You can submit a talk proposal until the end of this month, but you'll need to brush up on your Japanese. 

📅 No _Rails World_ ticket? No problem. Michael Buckbee suggests [many other Ruby events to consider.](https://wafris.org/blog/no-rails-world-ticket/) 

💡 Greg Molnar shares his [latest Rails tip of the week](https://greg.molnar.io/blog/rails-tricks-issue-13/) by demonstrating how to run `bundle audit` and `yarn audit` on every PR and once each day to stay up to date with vulnerable dependencies. 

🏎 Rails creator [▶️ DHH went on the Software Defined Talk podcast](https://www.softwaredefinedtalk.com/421) to talk about all sorts of things including DHH's background, how 37signals works, programming books DHH likes, 37signals' "leaving the cloud" journey, MRSK, and, oh, motor racing.  

📕 Tutorials, Articles, and Videos 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/xbe4kqyqzrj94y8tfkas.jpg)](https://allaboutcoding.ghinda.com/a-comparison-of-multiple-generative-ai-tools-when-asking-for-ruby-on-rails-code)  

[A Comparison of AI Tools for Writing Rails Code](https://allaboutcoding.ghinda.com/a-comparison-of-multiple-generative-ai-tools-when-asking-for-ruby-on-rails-code) — Can ChatGPT, Phind, Cody, Rix, or GitHub Copilot turn a simple bit of HTML into a helper for a Rails app? Mostly, yes, but it's still best to think of such tools as more like an eager intern rather than an expert pair programmer.. 

Lucian Ghinda   

[An Example of Type-Checking in Ruby 3 using RBS](https://blog.kiprosh.com/type-checking-in-ruby-3-using-rbs/) — RBS has hardly set the Ruby world on fire, but if you want to remind yourself that [RBS](https://github.com/ruby/rbs) was a thing that was introduced with Ruby 3, this is a quick explainer with an example. 

Navaneeth Krishnan P   

[Rails' Hidden Gems: ActiveSupport Cache Increment and Decrement](https://www.honeybadger.io/blog/active-support-cache-increment/?utm_source=rubyweekly&utm_medium=email&utm_campaign=ruby) — Read an article from our series spotlighting Rails’ lesser-known gems. Check it out and level-up your Rails brain! 🧠 

Honeybadger sponsor   

[How a Year-Long LeetCode Habit Upped My Game](https://evilmartians.com/chronicles/how-a-year-long-leetcode-habit-upped-my-professional-game) — It’s not for everyone, but I admit I’ve enjoyed quite a few of the [LeetCode problems.](https://leetcode.com/problemset/all/) Ruby is one of their supported languages, too. 

Nina Torgunakova (Evil Martians)   

▶[Broadcasting Progress from Background Jobs](https://www.driftingruby.com/episodes/broadcasting-progress-from-background-jobs) — Keeping users updated on the progress of asynchronous background jobs can be challenging, but Turbo and Stimulus make it easier than you might think in a Rails app. _(22 minutes.)_ 

David Kimura (DriftingRuby)   

[Creating a Basic Ruby GUI App with Glimmer](https://dev.to/smackdh/ruby-gui-with-glimmer-2fkh) — [Glimmer](https://github.com/AndyObtiva/glimmer) is a DSL and framework for building GUI apps in Ruby that began in the JRuby world but is now happy with CRuby too (running atop LibUI). This is one developer’s slightly scrappy intro that may whet your appetite ([full code](https://github.com/smackdh/glimmer_app)). 

Mattias Velamsson   

▶[Discussing the Case for _Not_ Taking a Management Path](https://share.transistor.fm/s/5bbe09db) 
Remote Ruby podcast   

[Rails Generators, Templates and How They Work](https://garrettdimon.com/journal/posts/rails-generators-templates) 
Garrett Dimon  

🛠 Code & Tools  

[Minitest::Snapshots 1.0: Jest-Style Snapshot Testing](https://github.com/mattbrictson/minitest-snapshots) — _“Think of it as VCR, but for any value,”_ says Matt. It’s a Minitest plugin that saves values encountered during the first run, saves them (if they can be serialized as YAML), then uses those as fixtures (in a sense) for future runs. It’s a curious idea. 

Matt Brictson   

🎶 [WahWah 1.4: A Library for Reading Audio Metadata](https://github.com/aidewoode/wahwah) — For reading things like MP3 IDv3 tags, embedded images, and similar metadata in formats including MP3, M4A, OGG, OGA, OPUS, WAV, FLAC, etc. Pure Ruby too, with no dependencies. 

Aidewoode   

[Fixed Price Monthly Code Maintenance for Rails Apps](https://reinteractive.com/service/code-care) — No time to do those small but critical updates and features? CodeCare will take care of necessary tweaks, bug fixes, upgrades and ongoing improvements for your app. 

reinteractive / CodeCare sponsor   

[CarrierWave 3.0: File Uploads for Ruby and Rack-Based Webapps](https://github.com/carrierwaveuploader/carrierwave) — Sinatra, Rails.. it’s not too fussy. [v3.0](https://github.com/carrierwaveuploader/carrierwave/releases/tag/v3.0.0) is essentially a big 'bug fixes and tweaks' release, with [a breaking change](https://github.com/carrierwaveuploader/carrierwave#upgrading-from-2x-or-earlier) to be aware of. 

CarrierWave   

[ActualDbSchema: Keep a Rails DB Schema Consistent When Switching Branches](https://github.com/widefix/actual_db_schema) — Migrations can get messy if you’re switching branches in a Rails app. The job of this project is to [clean up that mess](https://blog.widefix.com/actual-db-schema/). 

Andrei Kaleshka   

[Magic Numbers: A RuboCop Cop That Detects Magic Numbers](https://github.com/meetcleo/rubocop-magic_numbers) — Most apps have constant values of some kind and defining them _as constants_ is a good idea. This plugin for RuboCop detects such values in instance methods and brings them to your attention. 

Cleo AI   

[YouPlot: CLI to Draw Plots on the Terminal](https://github.com/red-data-tools/YouPlot) — The underlying plotting library is [Unicode Plot](https://github.com/red-data-tools/unicode_plot.rb) if you want to do similar things in your own code. 

Red Data Tools     

Jobs  

[Server Engineer (Ruby on Rails)](https://cognoa.breezy.hr/p/854f632c5e82-server-engineer) — Want to make a difference in kids’ lives? We create AI products for life-changing earlier diagnosis and care of autism. 
Cognoa   

[Find Ruby Jobs with Hired](https://hired.com/join/?utm_source=newsletter&utm_medium=sponsor&utm_campaign=%28b2c%29%28l-all%29%28r-all%29%28cooper-rubyweekly%29&utm_content=easy-job-hunting) — Hired makes job hunting easy-instead of chasing recruiters, companies approach you with salary details up front. Create a free profile now. 
Hired      

- [Rails 7.0.6](https://rubyonrails.org/2023/6/29/Rails-7-0-6-has-been-released)
- [Polyphony 1.4](https://github.com/digital-fabric/polyphony/blob/master/CHANGELOG.md#14-2023-07-01)
 ↳ Fiber-based concurrent app library.
- [Solidus v4.1](https://guides.solidus.io/upgrading-solidus/v4.1)
 ↳ Rails-based ecommerce platform.
- [Sequel 5.70.0](https://github.com/jeremyevans/sequel/discussions/2059)
 ↳ Popular SQL database toolkit.
- [Mongoid 8.1](https://github.com/mongodb/mongoid/releases/tag/v8.1.0)
 ↳ Official Ruby Object Mapper for MongoDB.
- [Pretender 0.5](https://github.com/ankane/pretender)
 ↳ Switch to/log in as another user in Rails.
- [Slowpoke 0.5](https://github.com/ankane/slowpoke)
 ↳ `Rack::Timeout` enhancements for Rails.
- [HAML-Lint 0.47](https://github.com/sds/haml-lint)
 ↳ Tool for writing clean, consistent [Haml.](https://haml.info/)
- [safe-pg-migrations 2.1](https://github.com/doctolib/safe-pg-migrations)
 ↳ Make your Postgres migrations safe(r).         

Curated by [Peter Cooper](https://twitter.com/cooperx86) and [Glenn Goodrich](https://twitter.com/ruprict).
Published by [Cooperpress](https://cooperpress.com/). 

[Change your email](https://rubyweekly.com/edit_subscription/*|UID|*) or [Stop getting this newsletter.](https://rubyweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom [Supporting Ukraine](https://linktr.ee/RazomForUkraine) 

Other weekly newsletters we publish include [Postgres Weekly](https://postgresweekly.com/), [React Status](https://react.statuscode.com/), [Frontend Focus](https://frontendfoc.us/), and [JavaScript Weekly](https://javascriptweekly.com/).
