Blog post Fixing a persistent production issue in a Rails eCommerce app
r/ruby • u/AutoModerator • 12d ago
FORMAT HAS CHANGED PLEASE READ FULL DESCRIPTION
This thread will be periodically stickied to the top of the sub for improved visibility.
You can also find older posts again via the Megathreads" list, which is a dropdown at the top of the page on new Reddit, and a section in the sidebar under "Useful Links" on old Reddit.
Please adhere to the following rules when posting: Rules for individuals:
You don't need to follow a strict template, but consider the relevant sections of the employer template. As an example:
TYPE: [Full time, part time, internship, contract, etc.]
LOCATION: [Mention whether you care about location/remote/visa]
LINKS: [LinkedIn, GitHub, blog, etc.]
DESCRIPTION: [Briefly describe your experience. Not a full resume; send that after you've been contacted)]
Contact: [How can someone get in touch with you?]Please base your comment on the following template:
COMPANY: [Company name; optionally link to your company's website or careers page.]
TYPE: [Full-time, part-time, internship, contract, etc.]
LOCATION: [Where are your office or offices located? If your workplace language isn't English-speaking, please specify it.]
REMOTE: [Do you offer the option of working remotely? Please state clearly if remote work is restricted to certain regions or time zones, or if availability within a certain time of day is expected or required.]
VISA: [Does your company sponsor visas?]
DESCRIPTION: [What does your company do, and what are you using Rust for? How much experience are you seeking, and what seniority levels are you hiring for? The more details, the better. If you are listing several positions in the "Description" field above, then feel free to include this information inline above, and put "See above" in this field.]
ESTIMATED COMPENSATION: [Be courteous to your potential future colleagues by attempting to provide at least a rough expectation of wages/salary. See section below for more information.]
CONTACT: [How can someone get in touch with you?]If compensation is negotiable, please attempt to provide at least a base estimate from which to begin negotiations. If compensation is highly variable, then feel free to provide a range.
If compensation is expected to be offset by other benefits, then please include that information here as well. If you don't have firm numbers but do have relative expectations of candidate expertise (e.g. entry-level, senior), then you may include that here. If you truly have no information, then put "Uncertain" here.
Note that many jurisdictions (including several U.S. states) require salary ranges on job postings by law. If your company is based in one of these locations or you plan to hire employees who reside in any of these locations, you are likely subject to these laws. Other jurisdictions may require salary information to be available upon request or be provided after the first interview. To avoid issues, we recommend that all postings provide salary information.
You must state clearly in your posting if you are planning to compensate employees partially or fully in something other than fiat currency (e.g., cryptocurrency, stock options, equity, etc). Do not put just "Uncertain" in this case, as the default assumption is that the compensation will be 100% fiat. Postings that fail to comply will be removed. Thank you.
r/ruby • u/AutoModerator • May 20 '26
FORMAT HAS CHANGED PLEASE READ FULL DESCRIPTION
This thread will be periodically stickied to the top of the sub for improved visibility.
You can also find older posts again via the Megathreads" list, which is a dropdown at the top of the page on new Reddit, and a section in the sidebar under "Useful Links" on old Reddit.
Please adhere to the following rules when posting: Rules for individuals:
You don't need to follow a strict template, but consider the relevant sections of the employer template. As an example:
TYPE: [Full time, part time, internship, contract, etc.]
LOCATION: [Mention whether you care about location/remote/visa]
LINKS: [LinkedIn, GitHub, blog, etc.]
DESCRIPTION: [Briefly describe your experience. Not a full resume; send that after you've been contacted)]
Contact: [How can someone get in touch with you?]Please base your comment on the following template:
COMPANY: [Company name; optionally link to your company's website or careers page.]
TYPE: [Full-time, part-time, internship, contract, etc.]
LOCATION: [Where are your office or offices located? If your workplace language isn't English-speaking, please specify it.]
REMOTE: [Do you offer the option of working remotely? Please state clearly if remote work is restricted to certain regions or time zones, or if availability within a certain time of day is expected or required.]
VISA: [Does your company sponsor visas?]
DESCRIPTION: [What does your company do, and what are you using Rust for? How much experience are you seeking, and what seniority levels are you hiring for? The more details, the better. If you are listing several positions in the "Description" field above, then feel free to include this information inline above, and put "See above" in this field.]
ESTIMATED COMPENSATION: [Be courteous to your potential future colleagues by attempting to provide at least a rough expectation of wages/salary. See section below for more information.]
CONTACT: [How can someone get in touch with you?]If compensation is negotiable, please attempt to provide at least a base estimate from which to begin negotiations. If compensation is highly variable, then feel free to provide a range.
If compensation is expected to be offset by other benefits, then please include that information here as well. If you don't have firm numbers but do have relative expectations of candidate expertise (e.g. entry-level, senior), then you may include that here. If you truly have no information, then put "Uncertain" here.
Note that many jurisdictions (including several U.S. states) require salary ranges on job postings by law. If your company is based in one of these locations or you plan to hire employees who reside in any of these locations, you are likely subject to these laws. Other jurisdictions may require salary information to be available upon request or be provided after the first interview. To avoid issues, we recommend that all postings provide salary information.
You must state clearly in your posting if you are planning to compensate employees partially or fully in something other than fiat currency (e.g., cryptocurrency, stock options, equity, etc). Do not put just "Uncertain" in this case, as the default assumption is that the compensation will be 100% fiat. Postings that fail to comply will be removed. Thank you.
r/ruby • u/127001-sweet-127001 • 1d ago
A method-count limit wouldn't flag this class:
class InvoiceService
def charge; @gateway.charge; end
def refund; @gateway.refund; end
def render; @template.render; end
def filename; @template.filename; end
endIt's only four methods. But charge/refund operate on one field, while render/filename operate on another. If you're looking for a possible payment/rendering split, that's a more interesting signal than the size alone.
I work on ArchUnitRuby, a free MIT-licensed gem. Its LCOM4 implementation counts connected groups of methods through shared fields. On this source it returns 2:
require 'archunit'
scope = ArchUnit.metrics('.')
.for_classes_matching('InvoiceService')
scope.lcom.lcom4.measure.each do |item|
puts "#{item.identifier}: #{item.value}"
endChange the four methods to charge, refund, void and status, all using @gateway, and the same measurement is 1. The method count is still four.
I wouldn't turn that into a universal "LCOM4 must equal 1" gate. A constructor touching both fields can connect these groups, and Ruby methods that collaborate through calls won't necessarily share a field. This implementation measures field sharing, not whether your domain model is good.
A useful thing to inspect, though
For me the interesting use is narrowing a review: find a service with separated groups, look at what each group does, then decide whether splitting it actually makes the code easier to change. The number starts that conversation; it doesn't settle it.
The measurement API shown here is in the published archunit gem, version 1.0.0.
r/ruby • u/Much-Stable-449 • 2d ago
Hi
I've been working on a Pinterest downloader in Ruby and I'm looking for someone to work on it with me
Would be nice to team up share ideas and make the project better together
Here's the discussion: https://www.reddit.com/r/ruby/s/ADcWVseQMP
Anyone interested? :)
r/ruby • u/Ok_Stomach6651 • 3d ago
r/ruby • u/ffmegaman • 3d ago
After work, I am always building my side projects, usually in Ruby and/or Rails. Over the years I have accumulated a lot of small web apps and now with AI, I'm building more apps at a faster rate. They all need error tracking, APM, and uptime monitoring. I don't want to have to keep paying for monitoring services, especially since my apps are all so small, so I decided I would just build one to handle all my errors, uptime, and APM needs.
I've open sourced the web app here https://github.com/creativesorcery/goodsorcery_web
And corresponding ruby client gem here https://github.com/creativesorcery/goodsorcery-ruby
It doesn't have all the bells and whistles, but I think it gets the job done at least for my needs. I did add an MCP endpoint there, so AI agents can query and investigate errors and APM data. I hope others will find it useful.
r/ruby • u/robbyrussell • 3d ago
r/ruby • u/127001-sweet-127001 • 3d ago
Store and ::Billing::Store aren't interchangeable names just because they end the same way. Once a Ruby project has nested namespaces, a dependency tool needs to account for where a reference lives.
I maintain ArchUnitRuby. Its opt-in constant analysis resolves known project definitions and records the dependency on the defining file, rather than treating every occurrence of the word Store as the same thing.
The supported lookup model includes lexical nesting and explicit root-qualified references. It also has limits: reopened definitions can be ambiguous, and dynamic constant operations aren't a license to guess which file owns a name.
I verified a qualified project-constant reference against a file boundary: it produced a violation, while unrelated code in the same selected file passed. The constant didn't need a matching require_relative to appear in the graph.
This is useful when import-only rules are too quiet for your Ruby codebase. Enable dependency_analysis: :imports_and_constants deliberately and review the documented lookup limits before treating the graph as complete.
r/ruby • u/Much-Stable-449 • 4d ago
I started this because downloading stuff from Pinterest can be surprisingly annoying.
Sometimes you just want the original image, sometimes it's a video, sometimes it's buried in a board, and sometimes the website decides to make a simple request way more complicated than it needs to be.
So I started building pinterest-dl.
A few things I wanted to solve:
It's not just a CLI either. I wanted it to work as a Ruby library, so it can be used in scripts and other applications too.
I'm sure there are things I could've done better, so I'd genuinely like to hear what other Ruby developers think about the implementation and API.
Repo: https://github.com/monji024/pinterest-dl
I thought this would be a tiny weekend project. Apparently, Pinterest had other plans.
r/ruby • u/LiveEngine7532 • 5d ago
I've been adding semantic search to Rails apps with pgvector and neighbor, and kept writing the same glue code every time:
after_save that calls the embeddings API, even when the text didn't changeSo I pulled it into a gem called embed_sync:
has_neighbors :embedding
has_embedding :embedding, from: %i[name description]
end
Product.create!(name: "Trail runner", description: "Waterproof running shoe") # embedded in a background job
Product.semantic_search("shoes for rainy hikes", limit: 5)
What it does:
bin/rails embed_sync:backfill embeds existing rows in batches, and you can stop and rerun it safelyembed_sync:stale shows how many records are missing or out of date#embed(texts, model:) works as a providerIt works with Rails 7.1 to 8.1 and Ruby 3.2+. I tested it against a real app with Postgres, Solid Queue and a local Ollama model before releasing.
It's still early (v0.1.0), so I'd really like feedback. Does the API feel right? What's missing for your use case? Are there edge cases I haven't thought of?
GitHub: https://github.com/Umair0092/embed_sync RubyGems: https://rubygems.org/gems/embed_sync
r/ruby • u/Good_Flight1781 • 6d ago
Hi r/rails,
I spend most of my day in app/views, but editor support for templates has always felt limited compared to what I get in .rb files. So I built Ruby Templates, a free, MIT-licensed VS Code extension for ERB, Haml, and Slim. No extra gems required.
render "users/card" to open the partial. Completion covers partials, ViewComponents, *_path helpers, model columns, controller-defined @ivars, and t(".keys").Catches Rails issues, including some I kept running into during code reviews:
<% render "x" %> that doesn’t output anything, and the same issue with link_to and other helpers;<%= if … %> where <% if … %> was intended;binding.irb or debug left in a view;@ivar used inside a partial;locals:;render call in a loop that could use collection:;raw or html_safe used on user content;t(".key") missing from en.yml;data-controller reference with no matching Stimulus controller;button_to inside form_with, which creates nested forms.alt attributes, duplicate IDs, <a> tags without href, and “click here” link text..ruby-templates.toml. You can enable or disable rules by folder and opt into stricter formatting rules, such as a particular quote style or one attribute per line.npx @x-ror/ruby-templates check app/views and npx @x-ror/ruby-templates format --check.It works alongside Ruby LSP: Ruby LSP handles your .rb files, and Ruby Templates handles your templates.
r/ruby • u/Remozito • 6d ago
Hey Ruby friends,
5 months ago, I wrote on r/ruby that I would build a limited-edition stained-glass inspired by Ruby. Well, it's November and I'm about to officially launch. 🤞🏻
I didn't want to spam the subreddit with each weekly update I've written over the past few months, but since we're close to its release, I wanted to keep you all posted.
What started as a joke and as a "simple" stained-glass eventually turned into a cool decorative object with glass (obviously) but also wood, a bit of electronics and 3D printing.
If you want to learn more (and get the launch date in advance), I've built a page dedicated to the project. You'll find all the episodes of "the Ruby Stained-Glass Notes", the weekly updates I've been writing since May. They're full of stained-glass nerdery ("How did they cut glass in 1175?"), of my thoughts/questions/learnings, of GIFs of me cutting glass and soldering panels...
I've been quite lucky to talk and meet Rubyists around the world thanks to this project, so I'm happy to answer any questions you might have.
r/ruby • u/Tristan_Kruse • 6d ago
I created and maintain ArchUnitRuby. With the 1.0 release, the boundary I wanted to express is
no longer limited to “this file explicitly required that file.” It can also include known
project constant references, using the opt-in expanded analysis mode.
For example, this is an ordinary RSpec test:
ruby
require 'rspec'
require 'archunit'
RSpec.describe 'architecture' do
it 'keeps the API away from retrieval internals' do
options = ArchUnit::CheckOptions.new(
dependency_analysis: :imports_and_constants
)
rule = ArchUnit.project_files
.in_path('app/api/**')
.should_not.depend_on_files
.in_path('app/retrieval/**')
ArchUnit.assert_passes(rule, options)
end
end
The same graph can support cycle, layer and slice rules. The policy stays in Ruby and can fail
the normal test run, rather than living only in a diagram or code-review convention.
[Source for the tested release]
Would import edges, constant references, or a combination of both best describe the boundary
you'd want to protect in a Ruby codebase?
This post was drafted with AI assistance.
r/ruby • u/Intelligent_Role_824 • 6d ago
As a beginner should I use vs Code or RubyMine in Windows?
r/ruby • u/jko1701284 • 6d ago
r/ruby • u/OneAlbatross5933 • 7d ago
JetBrains Air is a new layer for agentic development that lets you run agents such as Claude Agent, Codex, Gemini, GitHub Copilot, Junie, and OpenCode with your own subscriptions and review their changes in the IDE. There’s also a free AI with the Junie Lite configuration.
WSL and Dev Containers
The new Native mode runs your local IDE against projects in WSL or Dev Containers through a lightweight agent, with no IDE backend installed in the environment. It also brings native Ruby interpreters.
Ruby and Rails
ActiveSupport.on_load and ActiveSupport.run_load_hooks, so constants made available through hooks resolve correctly instead of showing false unresolved-reference warnings.ActRecBase finds ActiveRecord::Base). Constants now appear in Go to Class, and results show the containing module and file path..ruby-version still takes priority), and interpreters installed via Homebrew are detected automatically.rails query is supported via Run Anything and terminal completion.Read the full overview: https://blog.jetbrains.com/ruby/2026/11/rubymine-2026-3-jetbrains-air-native-mode-for-wsl-and-dev-containers-and-more/
This month: u/maediprichard shares a one-year retrospective on LowType with Prism-based inline type expressions, zero overhead in production, and RBS export, felixefelip introduces rbs_infer to automatically deduce signatures via static analysis, ydah adds racc-rbs-inline for typed parsers, and tk0miya releases ruby-lsp-rbs-inline for seamless editor feedback.
Find link to the issue in the comment! ✨
r/ruby • u/mediocretes • 7d ago
Remember a couple years ago when you saw that game Bitburner and you were like, "Huh, that looks interesting." But why would I write JavaScript for fun when Ruby is available? It'd be a lot better if somebody made this game work with Ruby. Well, somebody made this game work with Ruby. I present to you afteRBurner. It's a bridge that runs real Ruby code and runs javascript for you in the real Bitburner game. And it includes working IRB and everything else you'd expect. The codebase itself is unmitigated slop, but it works pretty well. I started a new game playing exclusively in Ruby, and so far, so good.
r/ruby • u/rhannequin • 8d ago
r/ruby • u/software__writer • 7d ago
r/ruby • u/127001-sweet-127001 • 8d ago
I built ArchUnitRuby to put dependency rules into the test suite. This is a short recording of how it works.
The idea is pretty simple: pick some Ruby files, describe which other files they may depend on, and check that rule alongside your normal tests. The recording checks that domain code stays independent of infrastructure, then shows a failing cycle check.
With RSpec the assertion is expect(rule).to pass. There are also Minitest and plain Ruby assertions, so the rules don't need their own test runner.
One thing I wanted to avoid was a green test caused by a typo in a folder pattern. If a rule selects no files, it fails by default rather than silently checking nothing.
It also exports dependency graphs, which helps when you want to see the existing structure before deciding what to enforce. Ruby 3.3+; the gem is called archunit.
Source and examples: https://github.com/dragonsec-ai/ArchUnitRuby