---
title: "Machine learning in Ruby"
publication: "Ruby Weekly"
issue: 664
published_at: "2023-07-27"
canonical_url: "https://rubyweekly.com/issues/664"
---

Plus dating gems, downloading mail over IMAP, and explaining Ruby's operators. |        

#​664 — July 27, 2023 

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

Together with [![pgAnalyze\](https://res.cloudinary.com/cpress/image/upload/c_fill,g_auto,e_trim,w_350,h_100/e_make_transparent/co_white,e_outline:7/lhwcvgc1asd4fzaahty4.png)](https://pganalyze.com/blog/introducing-vacuum-advisor-postgres?utm_source=RubyWeeklyPrimary07272023)   

Ruby Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/pyi9oywbdslgvungf04h.jpg)](https://www.youtube.com/watch?v=nO8vY1iNlgQ)  

▶[Forecasting the Future: An Intro to Machine Learning in Ruby](https://www.youtube.com/watch?v=nO8vY1iNlgQ) — Why let Python have all the fun? At RailsConf 2023, Landon Gray gave a talk about doing machine learning work in Ruby. Is it viable? Landon found a way through and shows off a complete process in just 15 minutes. 

Landon Gray   

All of [Andrew Kane's libraries](https://ankane.org/new-ml-gems) are worth exploring in this area, too, as he has been a huge proponent of doing ML in Ruby.  

[Active Storage in Production](https://discuss.rubyonrails.org/t/active-storage-in-production-lessons-learned-and-in-depth-look-at-how-it-works/83289) — It might just be a post on the Rails forum for now but Jeremy Smith [noted](https://twitter.com/jeremysmithco/status/1684530771954892801) on Twitter that this practical, experience-driven look at Rails’ Active Storage is: _“one of the best overviews I’ve read on Active Storage. Feels like it almost belongs in official documentation.”_ 

Breno Gazzola   [![\](https://copm.s3.amazonaws.com/48de4328.png)](https://pganalyze.com/blog/introducing-vacuum-advisor-postgres?utm_source=RubyWeeklyPrimary07272023) 

[Using Ruby and Postgres at Scale? Your App Probably Has VACUUM Issues](https://pganalyze.com/blog/introducing-vacuum-advisor-postgres?utm_source=RubyWeeklyPrimary07272023) — Stop worrying about autovacuum tuning. The new pganalyze VACUUM Advisor provides per-table recommendations for autovacuum settings to optimize table bloat, tune freezing, and improve query performance. 

pganalyze sponsor   

[RubyMine 2023.2 Released, Complete with AI Assistant](https://blog.jetbrains.com/ruby/2023/07/rubymine-2023-2-with-ai-assistant-is-out/) — The latest version of the commercial Ruby and Rails IDE gets on the AI train with a LLM-based assistant (that can even generate your commit messages), but also numerous other features like UI updates, improved RBS support, import map support, and code completion support for Turbo. 

Iryna Pisklyarova (JetBrains)   

❓ Rails 7.1 isn't quite here yet, but it's adding [a way to identify unused routes](https://www.shakacode.com/blog/identify-unused-routes-in-rails-7/) by way of running `rails routes --unused`. Other 7.1 additions include `ActiveJob#perform_all_later` to [enqueue multiple jobs at once](https://www.shakacode.com/blog/rails-adds-perform_all_later-to-activejob/) and Action Mailer [`*_deliver` callbacks](https://www.shakacode.com/blog/rails_add_deliver_callbacks_to_action_mailer/). 

👩‍💻 [Rails Hackathon](https://railshackathon.com/) is a remote hackathon for Rails developers that starts tomorrow and runs through the weekend. You get 48 hours to build a Rails app (alone or in a small team). Maybe [last year's winners](https://railshackathon.com/events/1-hotwire/winners) can provide you with some inspiration. 

📅 [The _Rails World_ speakers have been unveiled.](https://rubyonrails.org/world/speakers) If you were lucky enough to actually get a ticket and make it to Amsterdam this October, you'll get to see Aaron Patterson, Eileen Uchitelle, Adam Wathan, DHH, Irina Nazarova and others doing their thing. 

🧪 [Elixir](https://elixir-lang.org/) is an interesting Ruby-inspired Erlang VM-based language with a lot of parallels to Ruby, but the author of _Phoenix on Rails_ picks on [three key diffferences between Ruby and Elixir.](https://phoenixonrails.com/blog/elixir-for-ruby-developers-the-three-most-important-differences).  

📕 Tutorials, Articles, and Videos 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/zm9y8rtd3w1hcncivure.jpg)](https://kddnewton.com/2023/07/20/ruby-operators.html)  

[Ruby Operators Explained](https://kddnewton.com/2023/07/20/ruby-operators.html) — A nice list to add as a reference when you’re trying to remember bitwise or pattern-matching (or any) operators. 

Kevin Newton   

[How to Date a Gem](https://blog.testdouble.com/posts/2023-07-24-how-to-date-a-gem/) — No romance involved, alas, just the development of a library (called [GemDating](https://github.com/testdouble/gem_dating)) to find out-of-date dependencies (handy if you’re doing a Ruby or Rails version upgrade). 

Steve Jackson   

[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   

[Passkey Authentication with Rodauth](https://janko.io/passkey-authentication-with-rodauth/) — Rodauth’s feature set and flexibility keep getting stronger, as this support for the WebAuthn specification demonstrates, making MFA and passwordless login reasonably straightforward to implement. 

Janko Marohnić   

[How to Auto-Generate Plain-Text Emails](https://www.netskin.com/posts/20230716-autogenerate-plain-email-version) — Most email clients render HTML emails, but sending a plain text version at the same time is a good practice and Tom has a slightly hacky but quick way to pull it off here. 

Tom Rothe   

If you have the opposite problem and want to make good looking HTML emails, _Drifting Ruby_ has you covered with [▶️ Fancy Emails with MJML](https://www.driftingruby.com/episodes/fancy-emails-with-mjml).  

[Does Basecamp/Hey Use ViewComponents?](https://discuss.rubyonrails.org/t/do-basecamp-hey-use-viewcomponents/83270) — In short, no, and DHH popped up to explain what they do instead. 

Ruby on Rails Discussions   

[How to Dynamically Create Instance Variables in Ruby](https://www.akshaykhot.com/dynamically-create-instance-variables-ruby/) — Say hello to `instance_variable_set`. 

Akshay Khot   

[A Brief Introduction to Rails Initializers: Why, What, and How](https://www.akshaykhot.com/introduction-to-rails-initializers/) 

Akshay Khot   

[Common Distance Metrics Implemented in Ruby](https://www.vector-logic.com/blog/posts/common-distance-metrics-implemented-in-ruby) 
Domhnall Murphy   

[Exploring Genetic Algorithms with Ruby](https://dev.to/rpaweb/exploring-genetic-algorithms-with-ruby-4lae) 
Rafael Peña-Azar  

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/omutvfgkngbl1cncbmsp.jpg)](https://github.com/joeyates/imap-backup)  

[imap-backup 11.0: A Tool to Backup IMAP Accounts](https://github.com/joeyates/imap-backup) — A tool to mirror, migrate, or even restore email accounts accessible over IMAP. [v11](https://github.com/joeyates/imap-backup/releases/tag/v11.0.0) includes a change to the downloading approach that yields significant performance improvements for downloading mailboxes with 100k+ messages. 

Joe Yates   

[ruby-macho 4.0: Pure-Ruby Library for Parsing Mach-O Files](https://github.com/Homebrew/ruby-macho/releases/tag/v4.0.0) — The Mach-O file format is used by macOS and iOS as a general purpose binary format. This library comes from the _Homebrew_ package manager project which has just released [Homebrew 4.1.2](https://github.com/Homebrew/brew/releases/tag/4.1.2) which includes a new offline, signed and notarized installer. 

Homebrew Project   

[Well, Crud … The Person Who Can Do That Is Gone](https://link.testdouble.com/what-now) — And yet you still need to get stuff done and ship features. We can help you figure it out and keep it that way. Let’s go. 

Test Double sponsor   

[Strong Migrations 1.6: Catch Unsafe Migrations in Development](https://github.com/ankane/strong_migrations) — Detects potentially dangerous operations and prevents them running by default. 

Andrew Kane   

[Win32::Screenshot: Capture Screenshots in Windows from Ruby](https://github.com/jarmo/win32screenshot) — It uses FFI to directly call the relevant functions in the legacy Windows GDI system. 

Jarmo Pertman     

Jobs  

[Senior Backend Engineer (Backend)](https://sweatcoin.teamtailor.com/jobs/2274924-senior-backend-developer-ruby-on-rails?promotion=595108-trackable-share-link-rubyweekly) — 12M user devices sent us data daily last week, 6M of them opened the app. Apply your knowledge and help make our users healthier. 
Sweatcoin   

[Senior Fullstack Engineer - Core Team (Europe)](https://booqable.com/careers/devops-stability) — Booqable prides itself on being a global company with team members working together from across the world. We are remote-first, so you can join us from wherever you are. 
Booqable   

[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      

- [yabeda-rack-ratelimit](https://github.com/basecamp/yabeda-rack-ratelimit)
 ↳ A Yabeda plugin for `Rack::Ratelimit` from Basecamp.
- [Valvat 1.4](https://github.com/yolk/valvat)
 ↳ Validates European VAT numbers.
- [Lamby 5.2](https://github.com/rails-lambda/lamby)
 ↳ AWS Lambda integration for Rails.
- [elasticsearch-ruby 8.9](https://github.com/elastic/elasticsearch-ruby/releases/tag/v8.9.0)
 ↳ Ruby integrations for Elasticsearch.
- [CeWL - Custom Word List Generator 6](https://github.com/digininja/CeWL)
 ↳ Crawls a site and creates word lists.
- [Optimist 3.1](https://github.com/ManageIQ/optimist)
 ↳ Simple command-line option parser library.
- [GraphqlRails 2.4](https://github.com/samesystem/graphql_rails)
 ↳ Write GraphQL server side the Rails way.
- [FastCount 0.2](https://github.com/fatkodima/fast_count)
 ↳ Quickly get a count estimation for large tables.
- [minitest 5.19.0](https://www.zenspider.com/releases/2023/07/minitest-version-5-19-0-has-been-released.html)
- [MRSK 0.15.1](https://github.com/mrsked/mrsk)         

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/).
