Generating and streaming ZIP archives on the fly

Posted Almost 2 years ago by Arne Hartherz.

When your Rails application offers downloading a bunch of files as ZIP archive, you basically have two options:

Fix for mysql2 error "Incorrect MySQL client library version! This gem was compiled for x.x.x but the client library is y.y.y."

Posted Almost 2 years ago by Tobias Kraze.

This should be fixed in the latest LTS-branches of our mysql2 fork, 0.2.x-lts and 0.3.x-lts...

Double loading issue with Ruby default gems

Posted Almost 2 years ago by Emanuel.

Ruby includes many standard gems that are bundled into the Ruby installation. Here is an example for the gem strscan...

net-ssh and openssl-3.0.0

Posted About 2 years ago by Stefan Langenmaier.

You'll need openssl-3 or newer for servers running 22.04 Ruby version 3.1 uses by default the gem openssl...

Use DatabaseCleaner with multiple test databases

Posted About 2 years ago by Dominic Beger.

There is a way to use multiple databases in Rails. You may have asked yourself how you're able to...

Gem development: recommended gem metadata

Posted About 2 years ago by Daniel Straßner.

The gemspec for gems allows to add metadata to your gem, some of which have a special meaning and are...

How to get information about a gem (via CLI or at runtime from Ruby)

Posted About 2 years ago by Arne Hartherz.

When you need information about a gem (like version(s) or install path(s)), you can use the gem binary...

Generating an Entity Relationship Diagram for your Rails application

Posted About 2 years ago by Arne Hartherz.

This card explains how to generate an entity relationship diagram for your Rails application. We also show how to limit...

Version 5 of the Ruby Redis gem removes Redis.current

Posted Over 2 years ago by Arne Hartherz.

Redis.current will be removed without replacement in redis-rb 5.0. Version 4.6.0 adds deprecation warnings for Redis.current and Redis.current=: `Redis.current...

Integrating ESLint

Posted Over 2 years ago.

To ensure a consistent code style for JavaScript code, we use ESLint. The workflow is similar to integrating rubocop...

How to add esbuild to the rails asset pipeline

Posted Over 2 years ago.

This are the steps I needed to do to add esbuild to an application that used the vanilla rails asset...

Terminator setup for Procfile-based applications for more comfortable debugging

Posted Over 2 years ago by Klaus Weidinger.

We use foreman to start all necessary processes for an application, which are declared in a Procfile. This is very...

New gem: Rack::SteadyETag

Posted Over 2 years ago by Henning Koch.
github.com

Rack::SteadyETag is a Rack middleware that generates the same default ETag for responses that only differ in CSRF tokens...

Google Chrome now has a JavaScript bundle visualizer

Posted Over 2 years ago by Dominik Schöler.
umaar.com

Similar to the Webpack Bundle Analyzer, Chrome's new Lighthouse feature … … shows a visualisation of your JavaScript bundles. It's...

ES6 imports are hoisted to the top

Posted Over 2 years ago by Henning Koch.

From Exploring ES6: Module imports are hoisted (internally moved to the beginning of the current scope). Therefore, it doesn’t...

RSpec: how to prevent the Rails debug page if you want to actually test for 404s

Posted Over 2 years ago by Klaus Weidinger.

Within development and test environments, Rails is usually configured to show a detailed debug page instead of 404s. However, there...

RSpec: automatic creation of VCR cassettes

Posted Over 2 years ago by Klaus Weidinger.

This RailsCast demonstrated a very convenient method to activate VCR for a spec by simply tagging it with :vcr.

Fix REPL of better_errors page

Posted Over 2 years ago.

The gem better_errors offers a detailed error page with an interactive REPL for better debugging. I had the issue...

RSpec matcher to compare two HTML fragments

Posted Over 2 years ago by Henning Koch.

The RSpec matcher tests if two HTML fragments are equivalent. Equivalency means: Whitespace is ignored Types of attribute quotes are...

How to extract a Ruby gem

Posted Almost 3 years ago by Emanuel.

The rubygems binary gem allows to extract a local gem with gem unpack GEMNAME. For more details see the official...

Spreewald development steps

Posted Almost 3 years ago by Emanuel.

Our gem spreewald supports a few helpers for development. In case you notice errors in your Cucumber tests, you might...

How to avoid raising RestClient exceptions for 4xx or 5xx results

Posted Almost 3 years ago by Arne Hartherz.

When using RestClient to make an HTTP request, it will raise an exception when receiving a non-successful response.

GitHub Actions: Retrying a failing step

Posted Almost 3 years ago by Henning Koch.

If you have a flaky command you can use the nick-invision/retry to re-try a failing command, optionally...

How to checkout submodules in Gitlab CI

Posted Almost 3 years ago by Emanuel.

Accessing other repositories in Gitlab CI is not straight forward, since the access rights of the current pipeline might not...