/r/ruby

Photograph via snooOG

Celebrate the weird and wonderful Ruby programming language with us!

A sub-Reddit for discussion and news about Ruby programming.

Learning Ruby?

Tools

Documentation

Books

Screencasts and Videos

News and updates

/r/ruby

87,320 Subscribers

0

How to use Claude with Ruby on Rails?

Does anyone know how to integrate Claude with Ruby on Rails? Can you tell me the resources to read to implement it?

7 Comments
2025/02/01
18:09 UTC

19

How to Debug a Ruby Microservice in Kubernetes with mirrord

Hey all, sharing a guide we wrote on debugging a Ruby microservice running in a Kubernetes cluster using mirrord, an OSS devtool we built.

In short, it shows how to run your Ruby service locally but with live access to cluster resources and context so you can test and debug changes quickly and without deploying.

I hope you find it useful, and would love to hear any feedback you might have.

https://metalbear.co/guides/how-to-debug-a-ruby-microservice/

2 Comments
2025/01/30
20:27 UTC

15

Looking for Feedback on API Security: How to Restrict Access to Only My Frontend (Not Postman or External Tools)

Hi everyone,

I’ve been working on securing my API and ensuring that only my frontend (an Angular app) can access it — preventing any external tools like Postman or custom scripts from making requests.

Here’s the solution I’ve come up with so far:

  1. JWT Authentication for user login and session management.
  2. Session Cookies (HTTP-only) for securely maintaining the session in the browser. The cookie cannot be accessed via client-side scripts, making it harder for attackers to steal the session.
  3. X-Random Token which is linked to the session and expires after a short time (e.g., 5 minutes).
  4. X-Tot (Expiration Timestamp) that ensures requests are recent and within a valid time window, preventing replay attacks.
  5. CORS Restrictions to ensure that only requests coming from the frontend domain are allowed.
  6. Rate Limiting to prevent abuse, such as multiple failed login attempts or rapid, repeated requests.
  7. SameSite Cookies to prevent Cross-Site Request Forgery (CSRF) attacks.

The goal is to make sure that users can only interact with the API via the official frontend (Angular app) and that Postman, scripts, or any external tool cannot spoof legitimate requests.

I’m looking for feedback:

  • Can this solution be improved?
  • Are there any gaps in security I might be missing?
  • What other layers should I add to ensure only the frontend can communicate with my API?

Thanks in advance for your thoughts and suggestions!

24 Comments
2025/01/30
11:18 UTC

2

Ruby binary location changed - Where can I get these notifications?

0 Comments
2025/01/30
04:40 UTC

22

Solargraph 0.51.x released with Ruby 3.4 fixes, go-to-type-definition support and more

Read the Changelog for more: https://github.com/castwide/solargraph/blob/master/CHANGELOG.md#0510---january-19-2025

Also NOTE: In case, you're using solargraph-rspec plugin, you need to upgrade it to the latest version due to parser compatibility issues.

2 Comments
2025/01/29
20:19 UTC

26

Share your Ruby gems that helped most with database performance

Hey Ruby community! 👋

I'm a long-time Rubyist from Brazil working on improving our database ecosystem. I maintain the timescaledb gem and am currently putting together performance workshops for Ruby/Rails developers focused on PostgreSQL internals.

TimescaleDB is kindly sponsoring efforts to improve database tooling across different language ecosystems, including Ruby. I'm looking to learn from your real-world experiences with time-series data and performance optimization.

In the past, I relied heavily on NewRelic for production performance debugging, but I've been away from this space for a while. For my upcoming workshop research:

- What gems are you using to detect and fix performance issues?
- Are there any open-source alternatives you'd recommend?

19 Comments
2025/01/29
20:13 UTC

6

Work it Wednesday: Who is hiring? Who is looking?

Companies and recruiters

Please make a top-level comment describing your company and job.

Encouraged: Job postings are encouraged to include: salary range, experience level desired, timezone (if remote) or location requirements, and any work restrictions (such as citizenship requirements). These don't have to be in the comment, they can be in the link.

Encouraged: Linking to a specific job posting. Links to job boards are okay, but the more specific to Ruby they can be, the better.

Developers - Looking for a job

If you are looking for a job: respond to a comment, DM, or use the contact info in the link to apply or ask questions. Also, feel free to make a top-level "I am looking" post.

Developers - Not looking for a job

If you know of someone else hiring, feel free to add a link or resource.

About

This is a scheduled and recurring post (one post a month: Wednesday at 15:00 UTC). Please do not make "we are hiring" posts outside of this post. You can view older posts by searching through the sub history.

4 Comments
2025/01/29
16:01 UTC

224

Which one of you is this?

18 Comments
2025/01/29
15:40 UTC

14

Launched a lightweight, free deprecation monitoring tool

RubyGems use deprecation warnings to let users know about upcoming breaking changes that will affect their codebase. Larger projects like Rails rely heavily on these warnings for communication — the Rails upgrade guide, for example, won’t even mention minor breaking changes as long as there’s a deprecation warning in place. Missing any of these warnings during an upgrade can lead to an unexpected failure in production.

Our tool monitors for deprecation warnings at runtime, helping you catch breaking changes that aren’t covered by your test suite. You can install our gem in your staging, QA, and production environments to track warnings before you merge a breaking change in an upgrade. Under the hood it works similarly to an error tracking system like Rollbar or Sentry but for deprecations instead.

It's free and you can try it out by following the instructions in the docs. Would love any feedback.

3 Comments
2025/01/29
14:50 UTC

126

Ruby Falcon is 2x faster than asynchronous Python, as fast as Node.js, and slightly slower than Go. Moreover, the Ruby code doesn’t include async/await spam.

61 Comments
2025/01/28
15:23 UTC

6

Ruby on Rails vs NodeJS

Hello. This is my first post here and I hope that I do not violate any rules.
I am mostly a Java guy working on Ruby now, and I love it a lot so far. I can see how much faster you can develop a business application using Ruby on Rails than with the Java frameworks I've used before.

Here is my main question: we are working on the new project's architecture and our choice of development tool is Ruby on Rails. However, the client is preferring NodeJs. My experience with that is limited, but I have the impression that Ruby would allow us to develop the application faster and with a smaller codebase. I wonder if there are any good articles comparing Ruby on Rails versus NodeJS?
Thank you in advance!

Edit: Thank you for the answers! I understand better now what I need to look for, it was very helpful!

20 Comments
2025/01/27
21:32 UTC

40

Feedback on Ruby Operator Lookup

Hey all, for years I've had this idea for a thing where you can browse through different Ruby operators, symbols, and syntax for when you encounter something in your code that you don't recognize or don't know what it is called.

I finally built the thing, and I'm calling it Ruby Operator Lookup -- https://www.visualmode.dev/ruby-operators

It was a ton of work and I'm proud of what I came up with. I think there are still a few rough edges to work out and a couple operators left to add.

In the meantime, I'd love some feedback!

  • Is this a useful resource?
  • Is it reasonably intuitive to use?
  • What could I improve?
  • Did you learn something new about Ruby looking through any of the operator pages?

Thanks in advance for your input. Cheers!

4 Comments
2025/01/27
18:50 UTC

17

Attraction Mailbox - Why I Love Action Mailbox (video)

0 Comments
2025/01/25
16:34 UTC

7

How to install Ruby 3.3 as system Ruby on Debian Sid?

The Ruby3.3 package in Debian Sid pulls in Ruby3.1 and makes it the default system Ruby. How do I switch to the newly installed 3.3 version?

$ sudo apt-get install ruby3.3
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
fonts-lato javascript-common libjs-jquery libruby libruby3.1t64 libruby3.3 rake ruby ruby-net-telnet ruby-rubygems ruby-sdbm ruby-webrick
ruby-xmlrpc ruby3.1 rubygems-integration unzip zip
Suggested packages:
ri ruby-dev bundler
The following NEW packages will be installed:
fonts-lato javascript-common libjs-jquery libruby libruby3.1t64 libruby3.3 rake ruby ruby-net-telnet ruby-rubygems ruby-sdbm ruby-webrick
ruby-xmlrpc ruby3.1 ruby3.3 rubygems-integration unzip zip
0 upgraded, 18 newly installed, 0 to remove and 0 not upgraded.
...
$ ruby --version
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux-gnu]

Edit: I'm happy to say this appears to have been resolved!

27 Comments
2025/01/25
09:50 UTC

53

Esoteric DragonRuby Game Toolkit - context and source code in the comments

6 Comments
2025/01/25
00:54 UTC

92

CSS Zero 1.0 is here! 🎉🎉

Repo: https://github.com/lazaronixon/css-zero
Demo: https://csszero.lazaronixon.com/lookbook

  • No build (no React or Tailwind)
  • Tailwind-like design system
  • Tailwind-like utility classes
  • Shadcn-like components
  • Make the most of modern browsers
  • Everything only 364.12 kB (JS + CSS)
  • Integrated with Rails 8
10 Comments
2025/01/24
20:36 UTC

15

I try to create my first gem

Hello everyone,

As the title suggests, I'm in the process of creating my first Ruby gem. You might wonder why I'm posting here instead of simply publishing it and moving on. Well, I'm quite new to Ruby and would greatly appreciate it if someone could review my work and provide feedback on whether my approach is solid, at least for a first iteration.

I'm also unsure whether it's appropriate to share my GitHub URL here. Any guidance or advice would be greatly appreciated!

10 Comments
2025/01/24
13:28 UTC

59

Shoryuken Needs a New Home - Open source dilemma.

Hey everyone,

I’m the creator of Shoryuken, an SQS processor for Ruby. It’s been awesome running the project over the years and seeing it being used by so many people, including big companies. Shoryuken has given me a lot of joy!

Unfortunately, at this point, I just can’t keep up with it anymore. Life’s gotten too busy to give it the attention it deserves (I make no money from it). Issues and pull requests come in, and I feel bad not being able to help. I tried to archive the project to prevent people from putting in work that may not be reviewed, but that upset people because they are still using it and advocating for it. Unarchived, not maintained, is more comfortable than archived.

I got contributors over the years, but they eventually moved on (jobs, life, etc.).

I’d honestly love to see a company pick it up and take care of it, but let’s be real — that’s probably not happening with an open-source project like this.

I would love it if someone could share some ideas.

10 Comments
2025/01/23
21:32 UTC

Back To Top