Installing old versions of mysql2 on Ubuntu 20.04+

Posted Over 3 years ago by Tobias Kraze.

On some of our older projects, we use the mysql2 gem. Unfortunately, versions 0.2.x (required for Rails 2.3) and...

Rails: How to restore a postgres dump from the past

Posted Over 3 years ago by Emanuel.

It sometimes happen that a database dump, that would want to insert into your development database, does not match the...

How to implement simple queue limiting/throttling for Sidekiq

Posted Over 3 years ago by Arne Hartherz.

The sidekiq-rate-limiter gem allows rate-limiting Sidekiq jobs and works like a charm. However, it needs to be...

VCR and the webdrivers gem

Posted Over 3 years ago by Niklas Hä..

If you're using the webdrivers gem and VCR together, depending on your configuration, VCR will yell at you regulary...

Pagy

Posted Over 3 years ago.
github.com

Pagy is a gem for pagination. They make some bold claims: Pagy is the ultimate pagination gem that outperforms the...

Workflow: How to use a key management service to encrypt passwords in the database

Posted Over 3 years ago by Emanuel.
news.ycombinator.com

This is an extract from the linked article. It shows an approach on how to implement encrypted passwords with the...

How to fix: Rails query logs always show lib/active_record/log_subscriber.rb as source

Posted Over 3 years ago by Arne Hartherz.

Rails 5.2+ supports "verbose query logs" where it shows the source of a query in the application log.

Parallel cucumber: How to pass in cucumber arguments

Posted Over 3 years ago by Emanuel.

Here is an example with the --tags option. You need to wrap them inside --cucumber-options option of parallel_cucumber...

PostgreSQL: How to use with_advisory_lock to prevent race conditions

Posted Over 3 years ago.

If you want to prevent that two processes run some code at the same time you can use the gem...

Vortrag: Content Security Policy: Eine Einführung

Posted Almost 4 years ago by Tobias Kraze.

CSP hat zum Ziel einen Browser-seitigen Mechanismus zu schaffen um einige Angriffe auf Webseiten zu verhindern, hauptsächlich XSS...

Introducing GoodJob 1.0, a new Postgres-based, multithreaded, ActiveJob backend for Ruby on Rails

Posted Almost 4 years ago by Henning Koch.
island94.org

GoodJob is a new background worker gem. It's compatible with ActiveJob. We're huge fans of Sidekiq for its...

Fixing wall of warnings: already initialized constant Etc::PC_SYMLINK_MAX

Posted Almost 4 years ago by Dominik Schöler.
github.com

These warnings are printed when the etc Gem is installed, while etc is also included in Ruby. Fix with:

Automatically validating dependency licenses with LicenseFinder

Posted Almost 4 years ago by Dominik Schöler.

"Open-source software (OSS) is great. Anyone can use virtually any open-source code in their projects." Well, it depends...

PostgreSQL: Difference between text and varchar columns

Posted Almost 4 years ago by Michael Leimstädtner.
postgresql.org

PostgreSQL offers three character types for your columns: character varying(n) (also called varchar or just string): Contents are limited...

How to use Active Job to decouple your background processing from a gem

Posted Almost 4 years ago.

In a web application you sometimes have tasks that can not be processed during a request but need to go...

The ultimate guide to Ruby timeouts

Posted Almost 4 years ago by Dominik Schöler.
github.com

An unresponsive service can be worse than a down one. It can tie up your entire system if not handled...

Legacy CarrierWave: How to generate versions with different file extensions

Posted Almost 4 years ago by Michael Leimstädtner.

We use CarrierWave in many of our projects to store and serve files of various formats - mostly images. A common...

Ruby: Referencing global variables with the built-in English library

Posted Almost 4 years ago by Emanuel.

tl;dr Don't forget require 'English' if you use a named global such as $LAST_MATCH_INFO. Otherwise this...

whenever: Installing cron jobs only for a given Rails environment or Capistrano stage

Posted Almost 4 years ago by Henning Koch.

We use the whenever gem to automatically update the crontab of the servers we deploy to. By default, whenever will...

Ruby: Using the pry debugger in projects with older Ruby versions

Posted Almost 4 years ago by Emanuel.

In case you want to use pry with an older version of Ruby, you can try the following configurations.

Rubygems: Installing the last version of rubygems that has no rubyforge_project deprecation warning

Posted Almost 4 years ago by Emanuel.

You can install rubygems 3.0.8 (released on February 18, 2020) to keep all the Gem::Specification#rubyforge_project deprecation warnings...

How to: Run bundle install in parallel

Posted Almost 4 years ago by Emanuel.

You can run bundle install in parallel. This might be helpful for development, where you often install many new gems...

Five years of "Today I Learned" from Josh Branchaud

Posted About 4 years ago by Michael Leimstädtner.
github.com

The linked GitHub repository is a bit like our "dev" cards deck, but groomed from a single person (Josh Branchaud...

Rails: Concurrent requests in development and tests

Posted About 4 years ago by Emanuel.

With puma you can have concurrent requests. There are two concepts on how Puma can handle two incoming requests: Workers...