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...

Git: How to add changes matching a regular expression

Posted Almost 4 years ago by Arne Hartherz.

When you have many changes, and you want to spread them across different commits, here is a way to stage...

Five years of "Today I Learned" from Josh Branchaud

Posted Almost 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 Almost 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...

How to use Simplecov to find untested code in a Rails project with RSpec and Cucumber

Posted Almost 4 years ago by Judith Roth.

Simplecov is a code coverage tool. This helps you to find out which parts of your application are not tested...

Using #deep_dup for copying whole hashes and array

Posted Almost 4 years ago by Jakob Scholz.

"Everything in Ruby is an object". This is also true for nested hashes and arrays. If you copy a hash...

Bundler in deploy mode shares gems between patch-level Ruby versions

Posted Almost 4 years ago by Michael Leimstädtner.

A recent patch level Ruby update caused troubles to some of us as applications started to complain about incompatible gem...

Video transcoding: Web and native playback overview (April 2020)

Posted Almost 4 years ago by Michael Leimstädtner.

Embedding videos on a website is very easy, add a tag to your source code and it just works...

Heads up: Ruby's Net::HTTP silently retries a failing request

Posted About 4 years ago by Dominik Schöler.
engineering.wework.com

Ruby's Net::HTTP library repeats a failing request once, as long as it deems it idempotent (GET, HEAD etc...

Ruby: How to fetch a remote host's TLS certificate

Posted About 4 years ago by Arne Hartherz.

TLS/SSL certificates are often used for HTTPS traffic. Occasionally a service may also use their TLS certificate to support public...

Guide to String Encoding in Ruby

Posted About 4 years ago by Emanuel.
tenderlovemaking.com

The linked article has a great explanation how to to deal with string encodings in Ruby. Furthermore you can check...

Structuring Rails applications: the Modular Monorepo Monolith

Posted About 4 years ago by Dominik Schöler.
medium.com

Root Insurance runs their application as a monolithic Rails application – but they've modularized it inside its repository. Here is...

Capybara 'fill_in': Ambiguous match for different input names

Posted About 4 years ago by Jakob Scholz.

When you have two inputs, where one contains the name of the other (eg. Name and Name with special treatment...

Always convert and strip user-provided images to sRGB

Posted About 4 years ago by Michael Leimstädtner.

Debugging image color profiles is hard. You can't trust your eyes in this matter, as the image rendering depends...

How to set up SMTP email delivery with a Gmail account

Posted About 4 years ago by Jakob Scholz.

If you want to make your Rails application be capable of sending SMTP emails, check out the action mailer configuration...

Effectively Using Materialized Views in Ruby on Rails · pganalyze

Posted About 4 years ago by Henning Koch.
pganalyze.com

It's every developer's nightmare: SQL queries that get large and unwieldy. This can happen fairly quickly with the...

How to update the bundler version in a Gemfile.lock

Posted About 4 years ago by Emanuel.

Install the latest bundler version: gem install bundler Fetching bundler-2.3.5.gem Successfully installed bundler-2.3.5 1 gem installed Update the bundler...

Rbenv: Alias a Ruby version

Posted Over 4 years ago by Emanuel.

For newer Ubuntu versions we currently need to install the patch level version 1.8.7-p375, otherwise the dev dependencies from...

Bundler: How to release a gem with 2FA enabled

Posted Over 4 years ago by Emanuel.

Rubygems supports a 2FA for your account. Once enabled you need to provide your personal OTP code for every release...

Ruby: The YAML safe_load method hides some pitfalls

Posted Over 4 years ago by Emanuel.

The Ruby standard lib ships with a YAML Parser called Psych. But serializing and deserializing data seems not as obvious...

Capybara: Execute asynchronous JavaScript

Posted Over 4 years ago by Tobias Kraze.

Capybara provides execute_script and evaluate_script to execute JavaScript code in a Selenium-controlled browser. This however is not...

Email validation regex

Posted Over 4 years ago by Jakob Scholz.

There is a practical short list for valid/invalid example email addresses - Thanks to Florian L.! The definition for valid emails...

Integrating or upgrading makandra-rubocop

Posted Over 4 years ago by Daniel Straßner.

Most of the time it is a tedious task to apply a code style guide to an existing code...

Fix error: rails console No such file to load -- irb/encoding_aliases.rb (LoadError)

Posted Over 4 years ago by Florian Leinsinger.
github.com

I got this error after upgrading Ruby from 2.4.5 to 2.6.4 when I opened the Rails console - rails server still...