r/ruby

Cut Rails boot time with require-profiler and this guide
▲ 18 r/ruby+1 crossposts

Cut Rails boot time with require-profiler and this guide

This post introduces* a new profiler for Rails app, require-profiler, to get insights on what's happening during your Rails app's boot. Why does it matter? Well, check out the post to learn about that as well as some real-world examples of when cutting the boot time made difference.

* To be precise, the profiler has been introduced earlier this year at RubyKaigi but it grew much stronger since then.

evilmartians.com
u/palkan — 1 day ago
▲ 0 r/ruby

Everybody Guesses

Hi Reddit. This isn't specifically a Ruby or Rails post, but it's about something anyone maintaining a mature Rails application will recognize.

Code tells you what happens without telling you why anybody wanted it. We've always filled that gap by reading the code, guessing the intent, and asking somebody when the guess felt wrong.

AI coding agents do the same thing, except they can make a great many reasonable guesses before anybody notices one was wrong. The code still works. The tests still pass. The guess becomes one more pattern in the application, which makes it look even more intentional to the next person or agent.

I've spent a couple of decades living with the consequences of my own good ideas, so I wrote about why this worries me. The post connects agentic coding to Peter Naur, Tony Hoare, XP, software factories, and the old-fashioned responsibility to say no to code that works but is too difficult to understand.

It also argues for using faster agents to take smaller steps. More research, more feedback, and less archaeology at the end of a giant pull request.

https://blowmage.com/2026/08/18/everybody-guesses/

reddit.com
u/blowmage — 2 days ago
▲ 7 r/ruby+3 crossposts

Sharing a free email validation tool

Hi all,

I see a lot of posts here on how to validate if email exists before losing time doing outreach. I dug into a rabbit hole and finally come up with a service. It is free, I just want to get back at the comunity

https://trueform.cloud/docs/

Let me know what do you think about it, and if there are changes you would need for your use case :)

u/Mammoth-Article2382 — 6 days ago
▲ 10 r/ruby

Performance discrepancy between versions 2.7.4 and 4.0.6

Recently decided to try learning Ruby more consistently (before that I only touched it occasionally) - and was much pleased with it in various aspects. At some point I was curious to assess its general performance roughly (as I heard it had to be pretty slow but very long in the past). Then I found my system installed Ruby is somewhat outdated 2.7.4p191 (along with my ubuntu 18.04 on this specific laptop). So I learnt to deploy rbenv and installed 4.0.6 with it.

However I ran into small puzzling situation - I tried two small scripts - roughly doing double nested loop - one with simple arithmetic and another with building and using array (collatz sequence calculations and primes calculation by trial division) - and while for the first of them performance of the said two versions is roughly the same, with the other newer version looks a bit slower.

I'm pretty sure I missed something about versions installed or don't catch something about properly writing Ruby code - so any guidance is quite welcome!

Below come details (with this primes.rb script from my github):

$ rbenv local 4.0.6 
$ ruby --version
ruby 4.0.6 (2026-07-14 revision 03b6d3f889) +PRISM [x86_64-linux]

$ time MAXN=1000000 ruby primes.rb
primes[1000000] = 15485863

real0m41,003s
user0m40,985s
sys0m0,018s

$ rbenv local --unset
$ ruby --version
ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux]

$ time MAXN=1000000 ruby primes.rb
primes[1000000] = 15485863

real0m34,969s
user0m34,929s
sys0m0,042s

So you see, it looks like 2.7.4 behaves slightly (about 25%) faster in this case, while I remember (from googling) that there was effort to make Ruby 3.x faster than Ruby 2.x perhaps 3 times. Though I may misinterpret this and perhaps 2.7.4. got the same improvements as 3.x (compared to 2.0 etc)

u/RodionGork — 6 days ago
▲ 1 r/ruby+1 crossposts

Help me with CFP for RubyConf India

I am a ROR developer for 3 years now, need to submit a good Ruby/Rails related talk.

I know I should decide my topic based on the work I do but need suggestions from community what topics talks are good and knowledgeable.

Do let me know if you know anything intresting around Ruby or Rails.

Thanks

reddit.com
u/ogpare — 6 days ago
▲ 33 r/ruby+2 crossposts

Ruby vs. Rust for a hobby programmer. Which one should I pick?

Hey everyone,
I'm looking to learn programming purely as a hobby (definitely not looking for a career change). I've tried out a bunch of different languages, including Python, which honestly didn't really click for me, but the two that I found super cool and really enjoyed are Ruby and Rust.
I'm well aware of how completely different they are. One is high-level and expressive, the other is system-level and super performant. Even with those differences, I'm equally interested in both and can't decide where to start.
Long term, I'd love to build a mix of side projects just for fun, like:

A simple Web App / REST API

A real-time chat application

Maybe some Desktop Apps down the road

Since my main goal is just to have fun, learn, and build cool stuff, which one would you recommend starting with?
Appreciate any thoughts or advice!

reddit.com
u/Intelligent_Role_824 — 11 days ago
▲ 61 r/ruby+1 crossposts

Full speaker list for the 2026 SF Ruby Conference is out!

19 confirmed speakers for the 2026 SF Ruby Startup Conference. The lineup includes founders of Ruby startups, scaleup employees, authors of open source, and engineers building and experimenting with Ruby.

You can find speakers from companies like Gusto, Anthropic, Shopify, Intercom (Fin), and Evil Martians, as well as the authors of Yabeda, AnyCable, Solid Queue, and Ruby LLM.

Hope to see you there. Full speaker list: sfruby.com

u/Individual_Dot7019 — 9 days ago
▲ 30 r/ruby

I missed wkhtmltopdf and wicked_pdf, so I wrote a new HTML-to-PDF engine with a Ruby gem

I'm the author. wkhtmltopdf was archived in 2023, and since then the practical options have been an unmaintained binary or spawning headless Chrome. Neither felt right for the kind of documents I actually generate — invoices and reports that flow top to bottom — so I wrote a new engine.

sghtmltopdf is written in Rust and does not embed Chromium, WebKit or Gecko. CSS Fragmentation (break-before, break-inside, orphans, widows) and atpage are implemented directly, so page breaks are a first-class concern rather than something you approximate with print stylesheets and hope for.

On the Ruby side it's a native extension, so there's no subprocess and no temp files. It releases the GVL while rendering, so other Puma threads keep serving, and pages are streamed out as soon as their layout is final rather than being buffered until the end.

gem "sghtmltopdf"

pdf = Sghtmltopdf.render("<h1>Invoice</h1>", page_size: "A4")

There's also a CLI and an HTTP server sharing the same engine, and a Docker image with Japanese fonts bundled so output doesn't depend on host fonts.

What it deliberately doesn't do: execute JavaScript, or match a browser pixel for pixel. Full CSS coverage isn't a goal either. If you're rendering arbitrary web pages, headless Chrome is still the right tool.

This is an early 0.1 release and I'd like to hear where it breaks on real documents.

https://github.com/waka/sghtmltopdf

Docs: https://waka.github.io/sghtmltopdf/en/

u/yo_waka — 9 days ago
▲ 0 r/ruby

Just trying ruby-lsp. Seems unusable for debugging terminal scripts

I wanted to be able to debug a ruby script I'm writing that presents a menu and gets input. I jumped through various hoops but I think I have everything properly installed now - rbenv, ruby, bundle, and vscode. But output is still not appearing in either the debug console or the terminal.

Googling the problem, it looks like stdio in the target script is not allowed in vscode/ruby-lsp debugging. Do I understand correctly? If so, that looks like a major limitation and makes it unusable for my needs.

I am writing a reasonably simple terminal script in ruby and work would go faster if I could debug. Is there a combination of things that would allow me to debug a simple script that uses stdin/stdout. I'm on a mac.

reddit.com
u/dar512 — 8 days ago
▲ 27 r/ruby+1 crossposts

I'm writing this tiny parser and realized how easy it is to wire your own simple REPL.

Do not use use eval for the real thing if you aren't sure where the input is coming from, but its good enough to get started.

u/6stringfanatic — 9 days ago
▲ 35 r/ruby

Beginner starting from scratch: Is the Ruby ecosystem worth learning over Python?

Hey everyone!
I have zero programming experience and I’m looking to pick up coding as a hobby. My main goal right now is to understand how the web works under the hood, specifically building and consuming APIs (like fetching data from public APIs and working with JSON).
I’ve been reading a lot about Ruby (and Rails) recently, and its syntax looks very clean and human-readable. But I have a few honest questions before I dive in:

Is Ruby beginner-friendly for total newbies?
Can I actually grasp core concepts like HTTP requests, REST APIs, and database connections using Ruby without getting overwhelmed?

How is the Ruby ecosystem doing?
Is it still active and well-maintained for beginners? Or is it mostly supported by legacy systems?

Ruby vs. Python for a hobbyist:
Is Python just the objectively better choice because of its massive popularity, or does Ruby offer a smoother/more enjoyable learning experience for web-related stuff?

My long-term goal is just to enjoy building cool side projects, but I want a solid, fun starting point.
Would love to hear your thoughts, especially from anyone who started learning with Ruby recently! Thanks!

Edit: I'm not looking to get a job or change careers with this! Programming is purely a hobby for me. I just want to build cool personal projects in my free time and have fun along the way.

reddit.com
u/Intelligent_Role_824 — 11 days ago
▲ 16 r/ruby

I started a Discord for the French Ruby community, sharing it here in case it's useful to fellow frenchies !

France has a decent number of local Ruby meetups (Paris, Lyon, Toulouse, Nantes, Lille, Marseille all have active groups), but there wasn't really a place to hang out *between* meetups, no shared Discord, no central spot to ask a quick question or hear about what's happening in other cities.

I put together **France.rb** to fill that gap: help channels, a channel per city that relays local meetup events, and a freelance/jobs section since a good chunk of the French Ruby scene works independently. It's brand new (launched this week, still tiny), and it's mainly aimed at French speakers, so if you don't speak French it's probably not that useful to you day-to-day, but Rubyists from anywhere are welcome to drop in.

Not trying to compete with the official Ruby Discord linked on ruby-lang.org this is just something more specific to the French scene, meant to complement it.

https://discord.gg/tEbywwkYY

Happy to answer anything in the comments, and if you know a French-speaking Rubyist who might be into it, feel free to pass it along.

reddit.com
u/Kitchen_Friendship11 — 7 days ago
▲ 31 r/ruby+1 crossposts

RubyLLM::Schema Is Now Schematist: A JSON Schema DSL for Ruby with Full Draft 2020-12 Coverage

I maintain RubyLLM, and one of its dependencies has been quietly useful to people who have nothing to do with LLMs. It was always a clean, general purpose JSON Schema DSL. It was just called RubyLLM::Schema, so unless you already used RubyLLM you'd never find it.

It's now grown to fully cover the latest JSON Schema spec, Draft 2020-12, with no dependencies at all. Which earned it its own name: Schematist.

class Order &lt; Schematist::Schema
  string :kind, enum: %w[personal business]

  given kind: "business" do
    object :tax_details do
      string :vat_number
    end
  end
end

Order.new.to_json_schema
# =&gt; { "$schema" =&gt; "https://json-schema.org/draft/2020-12/schema", "title" =&gt; "Order",
#      "type" =&gt; "object", "if" =&gt; {...}, "then" =&gt; {...}, ... }

Eight lines of Ruby, 47 lines of JSON Schema.

What 1.x brings:

  • It emits actual JSON Schema. to_json_schema used to return {name:, description:, schema:, strict:}, which is OpenAI's response_format wrapper with the real schema buried inside it. Now you get a Draft 2020-12 document with string keys that any validator will take.
  • Full Draft 2020-12 coverage. Composition, unevaluated properties and items, patternProperties, propertyNames, prefixItems and open ended tuples, contains, annotations, content encoding, the core $ keywords, and if/then/else branches that hold any schema rather than a fixed list of validations.
  • A schema doesn't have to be an object. A type with a name declares a property, without a name it declares what the schema itself is. So a root, or a define, can be an array, a union, or a bare $ref.
  • Zero runtime dependencies.
  • Values can be procs, resolved when the document is rendered, so one schema class produces a different document per instance. Useful when an enum comes out of the database.

Existing users: there's a final ruby_llm-schema release that depends on Schematist and aliases the old constants, so RubyLLM::Schema keeps resolving while you migrate. to_json_schema changing shape is the one thing to watch, and the README has the migration.

All of this is part of my concerted effort to make Ruby the best language to build with LLMs.

Write-up: https://paolino.me/schematist/

Repo: https://github.com/crmne/schematist

reddit.com
u/crmne — 9 days ago