---
title: "Shopify's safer take on ERB"
publication: "Ruby Weekly"
issue: 660
published_at: "2023-06-29"
canonical_url: "https://rubyweekly.com/issues/660"
---

Plus customizing your Rails console, Ruby goes camping, and why vectors are the new JSON. |        

#​660 — June 29, 2023 

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

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/ebooks/advanced-database-programming-rails-postgres?utm_source=RubyWeeklySecondary06292023)   

Ruby Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/amc34zplaofeizfaxpoi.jpg)](https://observablehq.com/@asg017/making-sqlite-extension-gem-installable)  

[Making SQLite Extensions `gem install`-able in Ruby](https://observablehq.com/@asg017/making-sqlite-extension-gem-installable) — There isn’t an obvious ‘big story’ this week, so I want to shine a spotlight on [SQLite genius](https://observablehq.com/collection/@asg017/sqlite-blog) Alex Garcia. He’s created many interesting SQLite extensions to add [regexp support](https://github.com/asg017/sqlite-regex), [HTTP request support](https://github.com/asg017/sqlite-http), [vector search](https://github.com/asg017/sqlite-vss), and more, but if you wanted to use them from Ruby, it’s been difficult till now, but _12_ SQLite extensions are now just a `gem install`away.. 

Alex Garcia   

💡 An interesting consequence of this is opening up a simple, local way to work with vector data and vector distance queries, as are useful in modern ML/LLM projects. Here's [an example of that](https://observablehq.com/@asg017/introducing-sqlite-vss) in Python, but I'm working up a Ruby example right now..  

[Keeping Your Apps More Secure with Bundler](https://blog.appsignal.com/2023/06/28/keep-your-ruby-app-secure-with-bundler.html) — Bundler includes several security features and this post looks at a couple of them: `bundler audit` for finding dependencies with known vulnerabilities, and `bundler outdated` to ensure you are on the latest versions. 

Thomas Riboulet (AppSignal)   [![\](https://copm.s3.amazonaws.com/9c60c1e9.png)](https://pganalyze.com/ebooks/advanced-database-programming-rails-postgres?utm_source=RubyWeeklySecondary06292023) 

[Free eBook: Advanced Database Programming with Rails and Postgres](https://pganalyze.com/ebooks/advanced-database-programming-rails-postgres?utm_source=RubyWeeklySecondary06292023) — Learn about subqueries, materialized views, and custom data types in Postgres and Rails. We walk through realistic real-life examples, translating first into SQL, and then into Rails code. Every example comes with source code to follow along. 

pganalyze sponsor   

[Open Sourcing Shopify’s Ruby Builds](https://railsatscale.com/2023-06-16-open-sourcing-shopifys-ruby-builds/) — With one of the biggest Ruby deployments in the world, it’s no surprise Shopify has their own variant of CRuby. If you want to copy their approach, they’ve released [shopify-ruby-definitions](https://github.com/Shopify/ruby-definitions), a set of ruby-build definitions for their specially tweaked [Ruby fork.](https://github.com/Shopify/ruby) They also explain why they have to do this rather than run against Ruby head. 

Peter Zhu   

[How To Use 37signals’s MRSK with AWS and GitHub](https://jetrockets.com/blog/how-to-use-basecamp-s-mrsk-with-aws-and-github) — [MRSK](https://mrsk.dev/) is DHH’s new(ish) Ruby-based orchestration tool for deploying containerized apps. This post digs into the details of setting it up (including a Dockerfile if your Rails app doesn’t have one) and getting it working with GitHub Actions. 

Alexandrov and Masiutin   

💡 While MRSK is particularly at home with Rails 7, you can [get it to work deploying older Rails 6 apps](https://jetrockets.com/blog/good-oldies-mrsk-and-rails-6)too.   

- ⚠️ The core Ruby team has [released a new version of `URI`](https://www.ruby-lang.org/en/news/2023/06/29/redos-in-uri-CVE-2023-36617/) to resolve a ReDoS issue. Expect to see a swathe of gem updates as it's a common dependency.
- 👏 Congratulations to [🐦 Kevin Newton and Jemma Issroff](https://twitter.com/kddnewton/status/1674063152303013891) for being accepted as the Ruby core team's newest members. (If Jemma's name seems familiar to you, she used to write our _Tip of the Week_ feature.)
- 🌸 [Hanami 2.1.0 beta1](https://hanamirb.org/blog/2023/06/29/hanami-210beta1/) has been released, and as is typical for Hanami, they sneak a big development into a minor-sounding release with a new, more powerful view system.
- 📅 [Rails World](https://rubyonrails.org/world) is a new Rails conference taking place in October in Amsterdam, but if you didn't get on their mailing list in time, you won't be going: [all the tickets sold out in 45 minutes](https://world.hey.com/dhh/rails-world-sold-out-less-than-45-minutes-78a0b276), as DHH explains in his typically modest style 😆
- 🤖 JetBrains has [released EAP6 of RubyMine 2023.2](https://blog.jetbrains.com/ruby/2023/06/rubymine-2023-2-eap6-introducing-the-new-ai-assistant/) introducing a new 'AI assistant' to the popular commercial IDE. If you're a user, they've also released a post showing off [how to master RubyMine's new UI](https://blog.jetbrains.com/ruby/2023/06/mastering-the-new-ui/).
- 👑 In hosting platform Fly․io's [announcement about raising lotsa money](https://fly.io/blog/we-raised-a-bunch-of-money/), they joked that AWS's `us-east-1` region contains _"so many Rails apps that one of them was elected to the county Board of Supervisors."_ 😆  

📕 Tutorials, Articles, and Videos  

[How to Split a List into Multiple Equal Parts](https://www.akshaykhot.com/split-list-into-equal-parts-ruby-rails/) — `each_slice` iterates over enumerable objects in chunks of a defined length (which you can turn into an array with `#to_a`). Rails also offers `in_groups_of`. While `each_slice` is quite a commonly used `Enumerable` method, the [Enumerable docs](https://ruby-doc.org/3.2.2/Enumerable.html) are well worth an occasional browse – I’m always reminded of a few interesting ones I haven’t used. 

Akshay Khot   

[Let's Build a Webapp Without Rails](https://www.akshaykhot.com/building-web-application-without-rails/) — Frameworks and libraries like Rails, Hamami, and even Sinatra do a _lot_ behind the scenes to help us build webapps in Ruby, but what’s going on behind the scenes? Akshay takes a quick look. 

Akshay Khot   

[Optimize Memory and Database Queries in Ruby with Scout](https://ter.li/t0f4se) — Pinpoint performance issues with Scout's tracing logic. Fix problems before they impact customers with detailed backtraces. 

Scout APM sponsor   

[Vectors are the New JSON in Postgres](https://jkatz05.com/post/postgres/vectors-json-postgresql/) — When NoSQL was becoming popular, Postgres smartly added native JSON support and has, in time, built up numerous ways to work with it that rival most NoSQL efforts. Fast forward several years and ML and LLM embeddings are now making _vectors_ the data structure _du jour_ and Postgres is stepping up again. (Notably via [pgvector](https://github.com/pgvector/pgvector), an extension largely built by Ruby’s own Andrew Kane, well known for his tireless work [improving Ruby's machine learning ecosystem.](https://ankane.org/new-ml-gems)) 

Jonathan Katz   

... [Range Literals and Their Effect on Active Record Queries](https://allaboutcoding.ghinda.com/rubys-range-literals-and-their-effect-on-rails-active-record-queries) — If you’re guessing this has much to do with which parts of the range are included or excluded in the queries, you’re right. 

Lucian Ghinda   

[Improve Your GitHub Workflow with Better Repository Defaults](https://mattbrictson.com/blog/github-repo-setup) — Some opinionated suggestions to enhance your GitHub repo experience. 

Matt Brictson   

[If You Liked Shoes, You'll Love Glimmer](https://andymaleh.blogspot.com/2023/06/if-you-liked-shoes-youll-love-glimmer.html) — The options for building GUI apps in Ruby are only continuing to improve. 

Andy Maleh   

[Using Rails 7.1's `Rails.env.local?`](https://blog.saeloun.com/2023/06/26/rails-env-local/) — A quick way to tell if you’re in a non-production environment. 

Vipul A M   

[Tips on Customizing the Rails Console with `.irbrc`](https://greg.molnar.io/blog/rails-tricks-issue-12/) 
Greg Molnar  

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/e9t3jghmkbmxcobpoqrw.jpg)](https://github.com/Shopify/better-html)  

[Better HTML: HTML-Aware ERB for Rails](https://github.com/Shopify/better-html) — You can generally render almost anything with an ERB template, but Better HTML introduces a little more control when it comes to HTML with runtime checks to restrict syntax, prevent certain types of interpolation, and being able to only insert expressions into script tags rather than statements/conditionals. 

Shopify   

[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   

[VCR 6.2: Record Your Test Suite's HTTP Interactions and Replay Them](https://github.com/vcr/vcr) — A long standing library for recording HTTP interactions and replaying them during test runs. Following 6.1 by over a year years, 6.2 is principally a release with fixes and dependency updates. 

VCR   

- [RuboCop 1.53.0](https://github.com/rubocop/rubocop/releases/tag/v1.53.0) – which now also has [a VS Code extension](https://marketplace.visualstudio.com/items?itemName=rubocop.vscode-rubocop) using RuboCop's new built-in LSP server.
- [Camping 3.1](https://github.com/camping/camping)
 ↳ An influential, tiny webapp framework that's now _18 years old._
- [ViewComponent 3.3](https://viewcomponent.org/)
 ↳ Reusable, encapsulated view components for Rails.
- [jQuery-Rails 4.6](https://github.com/rails/jquery-rails)
 ↳ Party like it's 2009! Now supports [jQuery 3.7.0.](https://blog.jquery.com/2023/05/11/jquery-3-7-0-released-staying-in-order/)
- [Maxitest 5.1](https://github.com/grosser/maxitest)
 ↳ Minitest, but with a lot of extra features.
- [SmarterCSV 1.8.5](https://github.com/tilo/smarter_csv)
 ↳ Load CSV into an array of hashes.
- [CSV 3.2.7](https://github.com/ruby/csv/releases/tag/v3.2.7)
 ↳ The OG CSV reading and writing library.     

Jobs  

[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     

🥰 Love is in the air?  

🍏 [A Love Letter to Objective C!](https://thoughtbot.com/blog/a-love-letter-to-objective-c) — A curious 'love letter' that seems framed more as a “Ruby is fantastic, and Objective C is tolerable” comparison to me, but it’s interesting to see how a Rubyist looks at the feature-set of a quite different and `farMoreVerbose:yes:really`language. Picking up another language is rarely a bad idea, though. 

Ryan Krug         

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