• Tour
    Features Error tracking Uptime monitoring Status pages Cron & heartbeat monitoring
    Frameworks
    Ruby on Rails Laravel Django Phoenix
    Languages
    Ruby PHP Python JavaScript
    Elixir Crystal Node Go
  • Pricing
  • Blog
  • Docs
  • Status
  • Contact
  • Meet the 'Badgers
  • Log In
Get started for FREE
  • Blog Home
  • Honeybadger
  • Ruby
  • PHP
  • Python
  • Elixir
  • JavaScript
  • Posts by Topic
    Ruby (187) Honeybadger (81) Rails (61) JavaScript (60) PHP (51) Python (33) Laravel (33) Go (16) Briefing (13) Django (12) Node (12) DevOps (10) Elixir (8) Aws (8) Briefing 2021 Q3 (7) React (7) FounderQuest (6) Briefing 2021 Q2 (6) Error Handling (6) Conferences (5) Testing (5) Security (4) Developer Tools (4) Elastic Beanstalk (4) Heroku (3) Debugging (3) Docker (3) Markdown (3) Serverless (3) Websockets (3) Sql (3) Events (2) Jekyll (2) Startup Advice (2) Guest Post (2) Sidekiq (2) Git (2) Front End (2) Rspec (2) Oauth (2) Logging (2) GraphQL (2) Flask (2) Nextjs (2) DynamoDB (2) Case Studies (1) Performance (1) Allocation Stats (1) Integrations (1) Bitbucket (1) Mobile (1) Gophercon (1) Clients (1) Vue (1) Lambda (1) Turbolinks (1) Redis (1) CircleCI (1) GitHub (1) Crystal (1) Stripe (1) Saas (1) Elasticsearch (1) Import Maps (1) Build Systems (1) Minitest (1) Guzzle (1) Tdd (1) I18n (1) Github Actions (1) Postgresql (1) Xdebug (1) Zend Debugger (1) Phpdbg (1) Pdf (1) Multithreading (1) Concurrency (1) Web Workers (1) Fargate (1) Active Record (1) Django Q (1) Celery (1) Amazon S3 (1) Aws Lambda (1) Amazon Textract (1) Sucrase (1) Babel (1) Pdfs (1) Hanami (1) Discord (1) Active Support (1) Blazer (1) Ubuntu (1)
  • Write For Us
  • RSS Feed

Ruby Articles

Brought to you by Honeybadger—we combine error, uptime, and cron monitoring in one simple and easy-to-use app for developers.

Ditching your single page app for...turbolinks?

You tried turbolinks, once, and soon your app began to fail in strange and wonderful ways. But some people make it work. What's their secret? The answer is so simple, it just might amaze you.

  • author photo By Starr Horne
  • #javascript #rails #ruby
  • Sep 9, 2015

Creating Ruby enumerators on the fly

When you treat your collections as enumerators, you get to use all your favorite functions like #map and #reduce without having to write any extra code. In this post I show you how easy it is to create enumerators on the fly, without defining extra classes or messing around with the Enumerable module.

  • author photo By Starr Horne
  • #ruby
  • Sep 3, 2015

When to use freeze and frozen? in Ruby

These days it's pretty common to see #freeze used in Ruby code. But it's often not entirely clear WHY freeze is being used. In this post we'll look at the most common reasons a developer might freeze variables.

  • author photo By Starr Horne
  • #ruby
  • Sep 2, 2015

How to exit a Ruby program

If you want your app to behave well in a unix environment, it's important that it exit correctly. In this post you'll learn all about unix exit codes, the mechanism that Ruby uses to exit a program, and how you can add custom behavior on exit.

  • author photo By Starr Horne
  • #ruby
  • Sep 1, 2015

Avoid these traps when nesting Ruby modules

But buried within Ruby's nesting implementation - and Rails' autoload system - are a few traps that can cause your code to fail in strange and wonderful ways. In this post, we'll discuss the origin of these traps and how you can avoid them.

  • author photo By Starr Horne
  • #ruby
  • Aug 26, 2015

Working with Ruby exceptions outside of the rescue block

It's often useful to be able to get the most recent exception, even if your code doesn't control the lifecycle of that exception. In this post we explore a few of the ways to do this.

  • author photo By Starr Horne
  • #ruby
  • Aug 25, 2015

Mixing code and data in Ruby with DATA and __END__

Did you know that Ruby provides a way for your script to use its own source file as a source of data? It's a neat trick that can save you some time when writing one-off scripts and proofs of concept. Let's check it out!

  • author photo By Starr Horne
  • #ruby
  • Aug 19, 2015

Associative arrays in Ruby...what?

Have you ever had a bunch of data in an array, but needed to do a key/value lookup like you would with a hash? Fortunately, Ruby provides a mechanism for treating arrays as key-value structures. Let's check it out!

  • author photo By Starr Horne
  • #ruby
  • Aug 18, 2015

Using lazy enumerators to work with large files in Ruby

Files are just large collections of lines or characters. Lazy enumerators make it possible to to some very interesting and powerful things with them.

  • author photo By Starr Horne
  • #ruby
  • Aug 10, 2015

Benchmarking exceptions in Ruby - yep, they're slow.

Just how much slower are exceptions than other flow control mechanisms? In this post we use a simple benchmark to find out.

  • author photo By Starr Horne
  • #ruby
  • Aug 6, 2015

How to raise any object as a Ruby exception

It's a common misconception that the raise method only accepts exceptions as its argument. This post will show you how you can raise ANYTHING, including numbers, dates, and your own custom classes.

  • author photo By Starr Horne
  • #ruby
  • Aug 4, 2015

How Rails' fancy exception page works

One of the nice things about working with rails is that when something goes wrong in development, you get a really nice error detail page. Today we're going to take a look at how these fancy error pages work.

  • author photo By Starr Horne
  • #ruby
  • Aug 3, 2015

How to clear all Sidekiq queues, using the power of emoji

It’s easy to find code snippets that will delete the jobs from one Sidekiq queue. But we have lots of queues. I want to clear the jobs from all of them. After a little digging, I came up with an answer that seems to work well.

  • author photo By Starr Horne
  • #ruby
  • Jul 28, 2015

Use any C library from Ruby via Fiddle - the Ruby standard library's best kept secret.

Fiddle is a little-known module that was added to Ruby's standard library in 1.9.x. It allow you to interact directly with C libraries from Ruby. In this post we'll start with some simple examples and finish by using termios to talk to an arduino over a serial port.

  • author photo By Starr Horne
  • #ruby
  • Jul 27, 2015

How to add context data to exceptions in Ruby

Sometimes the standard backtrace / error message combo isn't enough. Sometimes you need extra data to locate the cause of an error. In this post we'll discuss three easy ways to add more context to your exceptions.

  • author photo By Starr Horne
  • #rails #ruby
  • Jul 23, 2015

Understanding Ruby's strange "Errno" exceptions

If you've ever taken a look at Ruby's exception hierarchy, you may have noticed something weird. In addition to all of the normal exceptions like RuntimeError and NoMethodError, there's an odd reference to Errno::* . This post discusses what these exceptions are and how to interpret them.

  • author photo By Starr Horne
  • #ruby
  • Jul 22, 2015

A theoretical introduction to unix daemons in Ruby

Unix daemons are programs that run in the background. Nginx, Postgres and OpenSSH are a few examples. They use a some special tricks to “detatch” their processes, and let them run independently of any terminal. I thought it’d be fun to do a post illustrating how they work in Ruby.

  • author photo By Starr Horne
  • #ruby
  • Jul 21, 2015

Logging local & instance variables when exceptions occur in Ruby

With hard-to-reproduce bugs, it can be really handy to log all of the local and instance variables along with the exception. This post shows you how. Along the way we'll introduce Ruby's binding system as well as the bindingofcaller gem - a powerful tool for introspection.

  • author photo By Starr Horne
  • #ruby
  • Jul 20, 2015

Ruby's case statement - advanced techniques

Nothing could be simpler and more boring than the case statement. It’s a holdover from C. You use it to replace a bunch of ifs. Case closed. Or is it? Actually, case statements in Ruby are a lot richer and more complex than you might imagine. Let’s take a look.

  • author photo By Starr Horne
  • #ruby
  • Jul 15, 2015

Remote Debugging with Byebug, Rails and Pow

Byebug is a simple to use, feature rich debugger for Ruby 2.x. In this post, we'll discuss how to set up remote debugging with byebug so that you can debug code running in Pow, Unicorn or other application servers.

  • author photo By Starr Horne
  • #rails #ruby
  • Jul 15, 2015
  • ← Previous
  • Next →

Get Honeybadger's best Ruby articles in your inbox

We publish 1-2 times per month. Subscribe to get our Ruby articles as soon as we publish them.

    We're Honeybadger. We'll never send you spam; we will send you cool stuff like exclusive content, memes, and swag.

    Product
    • Error tracking
    • Uptime monitoring
    • Status pages
    • Cron & heartbeat monitoring
    • Integrations
    • Plans & pricing
    • HB vs. Error Trackers
    • GDPR
    • Security
    Stacks
    • Rails
    • Laravel
    • Django
    • Phoenix
    • JavaScript
    • Ruby
    • Node
    • Python
    • PHP
    • Elixir
    • Crystal
    • Go
    • Cocoa
    Company
    • Meet the 'Badgers
    • Job openings
    • Brand assets
    • Terms of use
    • Privacy statement
    • Contact us
    Resources
    • Developer docs
    • Developer blog
    • Newsletter
    • Exceptional Creatures
    • FounderQuest
    • Twitter