---
title: "Ruby and IRB in the browser"
publication: "Ruby Weekly"
issue: 689
published_at: "2024-02-08"
canonical_url: "https://rubyweekly.com/issues/689"
---

Plus Turbo 8.0, using local LLMs from Ruby, and Phlexing your views. |        

#​689 — February 8, 2024 

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

Together with [![FastRuby.io\](https://res.cloudinary.com/cpress/image/upload/c_fill,g_auto,w_467,h_106/e_make_transparent/co_white,e_outline:14/y65nyff19ylf5udphsq4.png)](https://go.fastruby.io/ozn)   

Ruby Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/nc0xwqgwq9tmk4n4m17g.jpg)](https://mame.github.io/emirb/)  

[`emirb`: An Experimental Build of IRB for the Browser](https://mame.github.io/emirb/) — What a neat demo! Yusuke, of the Ruby core team, has put together this browser based IRB experience using ruby-wasm-emscripten and [xterm-pty](https://xterm-pty.netlify.app/) to create the terminal experience seen here. Yusuke has written [more about the process here [JA\]](https://mametter.hatenablog.com/entry/2024/02/01/105413) _(it’s in Japanese but translates well)._ 

Yusuke Endoh   

[Turbo 8 Released](https://dev.37signals.com/turbo-8-released/) — While [Turbo](https://turbo.hotwired.dev/) is mostly a suite of frontend technologies, they’re becoming fundamental for the development of fast, modern Rails apps. 8.0 introduces a DOM morphing approach for smoother and more selective page updates ([example](https://dev.37signals.com/page-refreshes-with-morphing-demo/), supports the View Transition API, and can pre-load links prior to users clicking on them. 

37signals   [![\](https://copm.s3.amazonaws.com/f3ed2ba2.png)](https://go.fastruby.io/ozn) 

[Need to Upgrade Rails? Let’s Talk 🚀](https://go.fastruby.io/ozn) — Need an expert? Top-notch engineering teams (from startups to Fortune 500 companies) trust [the FastRuby.io team](https://www.fastruby.io/team) in mission-critical upgrades. Leverage our 30,000+ dev/hs of experience: Get to Ruby 3.3 and Rails 7.1 in weeks with zero downtime 🔥 

FastRuby.io Upgrade Services sponsor   

[First Steps with `ruby.wasm`: or _How We Built Ruby Next Playground_](https://evilmartians.com/chronicles/first-steps-with-ruby-wasm-or-building-ruby-next-playground) — The Ruby Next playground allows the execution of Ruby in the browser by using WASM and WASI to create an in-browser Ruby VM. This post digs into how it was built and why it could be useful. This is more about compiling and running programs than was the REPL-based `emirb`above. 

Dementyev and Turner (Evil Martians)   

- 🇨🇦 If you want to speak at the second _Rails World_, taking place in Toronto this September, [the Call for Papers is now open](https://rubyonrails.org/2024/2/5/rails-world-2024-cfp-is-open) until March 21.
- 🤦 GitHub cofounder Chris Wanstrath had his GitHub account suspended by a bot earlier this week. He's back up and running now, but if this can happen to [GitHub user #2..(!)](https://caius.github.io/github_id/#defunkt)
- 🎂 Neat to see DHH mentioning that [Basecamp has turned 20 years old.](https://world.hey.com/dhh/basecamp-turns-20-091d07b7) The original Basecamp was the app for which Rails was built (and extracted from).
- 📕 Aaron Sumner teases that a new edition of [Everyday Rails Testing with RSpec](https://everydayrails.com/2024/02/06/rspec-book-announcement-rails-7-1.html) targeting Rails 7.1 is on the way (in May, he hopes).
- Not every day you hear about [🐦 a JS project moving _to_ Rails..](https://twitter.com/Shpigford/status/1753188910304301260)  

📕 Articles & Tutorials  

[Running Open-Source AI Models Locally with Ruby](https://reinteractive.com/articles/running-open-source-AI-models-locally-with-ruby) — If you want to use company or sensitive data with AI models, or simply don’t want to give OpenAI or Google any more money, running them locally is a good idea. Running an LLM _in_ Ruby isn’t really viable, but [Ollama](https://ollama.ai/) makes it easy to run models locally and then call into them from your Ruby code – here’s how. 

Kane Hooper   

[Building Reusable UI Components in Rails with ViewComponent](https://www.honeybadger.io/blog/rails-viewcomponent/) — ViewComponent provides a nice way to make your views a bit more modular and loosely coupled when it comes to the components they’re made up of, rather than just leaning on partials. 

Michael Barasa   

💡 Be sure to also see Phlex (below) for an alternative approach.  

[How to Deploy a Rails App to a VPS with Kamal](https://www.honeybadger.io/blog/deploy-rails-with-kamal/?utm_source=rubyweekly&utm_medium=email&utm_campaign=ruby) — Building your app is only half the battle – the other half is deploying it. Learn how easy deploying can be with Kamal. 🚀 

Honeybadger sponsor   

[An Overview of RSpec Test Types in Rails](https://blog.appsignal.com/2024/02/07/a-deep-dive-into-rspec-tests-in-ruby-on-rails.html) — Knowing how and what to test can feel more like art than science. This list of the test types that are important for practical Rails testing, along with RSpec examples of each, may help you refine your approach. 

Thomas Riboulet (AppSignal)   

[The Secret Tool to Launch Your Rails Business in the App Stores](https://masilotti.com/launch-your-rails-business-in-the-app-store/) — Spoiler: It’s [_Turbo Native_](https://turbo.hotwired.dev/handbook/native) ;-) 

Joe Masilotti   

[Using Solid Queue in Development with Docker and on Heroku](https://stuff-things.net/2024/01/27/using-solid-queue-in-development-with-docker-and-on-heroku/) — [Solid Queue](https://dev.37signals.com/introducing-solid-queue/), open sourced by 37signals last month, is a database-based queuing backend for Active Job. 

Spike Ilacqua   

TIP: [Read the `.ruby-version` File Into Your Gemfile](https://andycroll.com/ruby/read-ruby-version-in-your-gemfile/) — To prevent confusion. 
Andy Croll   

▶[How to Add Live Reload to Your Rails App](https://webcrunch.com/posts/live-reload-rails) — Using esbuild. 
Webcrunch   

[What is `__FILE__` in Ruby?](https://www.writesoftwarewell.com/what-is-file-in-ruby/) 
Akshay Khot  

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/kutsijz2usyrrmsohpyr.jpg)](https://www.phlex.fun/)  

[Phlex: A Component-Oriented View Framework](https://www.phlex.fun/) — Phlex lets you treat everything on a page as a distinct component and build them all with Ruby itself. We’ve mentioned it a few times in the past year, but it now has a [nifty new homepage](https://www.phlex.fun/) that communicates the idea well and gets you up to speed quickly. 

Joel Drapper   

💡 [Streaming Phlex from Sinatra](https://www.benpickles.com/articles/93-streaming-phlex-from-sinatra) makes for an interesting use case. GoRails has also just dropped [▶️ Components with Phlex in Rails](https://gorails.com/episodes/components-with-phlex-in-rails)!  

[HTTP.rb / HTTP 'The Gem!' 5.2: The Fast Ruby HTTP Client](https://github.com/httprb/http) — I’m a big fan of the `http` gem, both for its memorable name 😏 and because it’s flexible while having an easy to remember API ([the wiki docs](https://github.com/httprb/http/wiki) are a big help, too). v5.2 is the first release since 2022, though, so it’s good to see it getting an update. 

http.rb team   

[Worried About Your Ruby on Rails Application's Security?](https://reinteractive.com/services-codecare-shield) — Never worry about outdated code again - CodeCare Shield ensures your Ruby on Rails app stays up-to-date and optimised. 

reinteractive/CodeCareShield sponsor   

[_Mission Control — Jobs_: Dashboard Extensions for Solid Queue](https://dev.37signals.com/mission-control-jobs/) — If you followed the Solid Queue release, you know it came with no web UI to manage jobs. 37signals has rectified that by open sourcing their frontend for it. [GitHub repo](https://github.com/basecamp/mission_control-jobs). 

Rosa Gutiérrez (37Signals)   

[`after_commit` Everywhere: Use Active Record Transactional Callbacks Outside of Models](https://github.com/Envek/after_commit_everywhere) — Not just outside of Active Record models but, well, anywhere in your app. Check the examples in the README to get the idea. 

Andrey Novikov   

- [Active Delivery 1.2](https://github.com/palkan/active_delivery) – Framework for centralized notifications.
- [Invisible Captcha 2.2](https://github.com/markets/invisible_captcha) – 'Honeypot' style protection for Rails apps.
- [Multipart::Post 2.4](https://github.com/socketry/multipart-post) – Add multipart POST capability to`net/http`.
- [Shoryuken 6.2](https://github.com/ruby-shoryuken/shoryuken) – Amazon SQS thread-based message processor.
- [Artemis 1.0](https://github.com/yuki24/artemis) – GraphQL client designed to fit well on Rails.
- [parallel_tests 4.5](https://github.com/grosser/parallel_tests) – More cores == faster tests.
- [Octokit 8.1](https://github.com/octokit/octokit.rb) – Ruby toolkit for the GitHub API.
- [Sequel 5.77](https://github.com/jeremyevans/sequel) – Popular database toolkit.
- [ActiveRecord::Bitemporal 5.0](https://github.com/kufu/activerecord-bitemporal)
- [RubyGems 3.5.6](https://blog.rubygems.org/2024/02/06/3.5.6-released.html)         

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 

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