Debugging a stuck Ruby process using gdb/lldb

This post is a case study of an issue I faced in the form of a stuck Ruby micro-service. The Rails server would boot up and service requests for a while until it would stop responding. The next problem was verification. How can we tell that the process is stuck?…

An Introduction to Ruby Modules

A not so gentle IntroductionModules are some of the most exciting concepts in Ruby, but it is also a feature that is not really understood by its users. For someone who is just starting out with the language and even to seasoned programmers, Ruby Modules can be confusing, especially when…

Understanding binding.pry

I have been using Pry as a repl and as a debugging tool for Ruby for as long as I can remember. I am a proficient user of the tool, but so far, I haven't put any effort to understand how Pry debugger works. Together, let's learn how Pry debugger…

Rails 6 introduces new code loader: Zeitwerk

Zeitwerk is the new code loader that comes with Rails 6 by default. In addition to providing autoloading, eager loading, and reloading capabilities, it also improves the classical code loader by being efficient and thread safe. According to the author of Zeitwerk, Xavier Noria, one of the main motivations for…

Setting up a high performance Geocoder

One of our applications uses geocoding extensively. When we started the project, we included the excellent Geocoder gem, and set Google as the geocoding backend. As the application scaled, its geocoding requirements grew and soon we were looking at geocoding bills worth thousands of dollars. Read more about this at:…