During deployment: "You are trying to install in deployment mode after changing your Gemfile"

Posted About 5 years ago by Thomas Eisenbarth.

While deploying an Ruby update to an old application these days, we encountered the following misleading error: *** [err :: some-host.makandra.de] You...

Why you can't use timezone codes like "PST" or "BST" for Time objects

Posted About 5 years ago by Arne Hartherz.

Rails' ActiveSupport::TimeWithZone objects have both a timezone code and offset, e.g. Thu, 28 Mar 2019 16:00:00 CET...

How to install bundler for Ruby < 2.3

Posted About 5 years ago by Emanuel.

Bundler 2 requires at least Ruby 2.3.0 and RubyGems 2.5.0. You might get the following error when you try to...

Rails asset pipeline: Using ESNext without a transpiler

Posted Over 5 years ago by Henning Koch.

If your app does not need to support IE11, you can use most ES6 features without a build step. Just...

Upgrading Ruby from 1.8.7 to 2.3.5

Posted Over 5 years ago by Dominik Schöler.

Suggested Workflow Set the ruby version in .ruby-version to 2.3.5, then perform these steps one by one, fixing errors...

How to create a Basic Auth header value

Posted Over 5 years ago by Arne Hartherz.

When doing Basic Authentication, your browser will send an "Authorization" header. Its value is simply a Base64-encoded representation of...

Ruby: Reading and writing CSVs

Posted Over 5 years ago by Emanuel.

In ruby you can easily read and write CSVs with the standard CSV library class. On top of this, you...

How to upgrade Rails: Workflow advice

Posted Over 5 years ago by Tobias Kraze.

When upgrading Rails versions -- especially major versions -- you will run into a lot of unique issues, depending on the exact...

How to: Use Ace editor in a Webpack project

Posted Over 5 years ago by Arne Hartherz.

The Ace editor is a great enhancement when you want users to supply some kind of code (HTML, JavaScript, Ruby...

Regular tasks for long-running projects

Posted Over 5 years ago by Dominik Schöler.

When projects run for many years, they require special regular maintenance to stay fresh. This kind of maintenance is usually...

Rubymine FileType mismatch

Posted Over 5 years ago by Natalie Zeumann.

If your Rubymine does not recognize a file type correctly although you have entered the unmistakeable file extension like material_orders_controller.rb...

Katapult 0.5.0 released

Posted Over 5 years ago by Dominik Schöler.
github.com

Deployment ready for Opscomplete Copying view and controller templates over to target application during basics configuration or via...

How to access before/after pseudo element styles with JavaScript

Posted Over 5 years ago by Arne Hartherz.

Accessing pseudo elements via JavaScript or jQuery is often painful/impossible. However, accessing their styles is fairly simple. Using getComputedStyle

Ruby's percent notation can do more than strings

Posted Over 5 years ago by Michael Leimstädtner.
docs.ruby-lang.org

Percent Notation We already know that that we can create strings using the percent notation: %(<foo="bar's ton">) is...

RubyMine: How to add a german spell checker

Posted Over 5 years ago by Emanuel.

Since the Spell checker german dictionary plugin is not maintained anymore, here is another way to use a german dictionary...

Ruby: required keyword arguments in the pre-2.1 era

Posted Over 5 years ago by Daniel Straßner.

Starting with Ruby 2.0 you can define methods with keyword arguments. In 2.1+ required keyword arguments can be defined by...

How to examine an unknown Ruby object

Posted Over 5 years ago by Dominik Schöler.

When debugging your application, you will come across objects created by some gem or framework. You don't have the...

Rbenv: How to remove a gem installed from a Github source

Posted Over 5 years ago by Emanuel.

Normally you can list all gems of the current ruby version with gem list, which also includes the gems of...

An incomplete guide to migrate a Rails application from paperclip to carrierwave

Posted Over 5 years ago by Emanuel.

In this example we assume that not only the storage gem changes but also the file structure on disc.

Raising JavaScript errors in Ruby E2E tests (RSpec, Cucumber)

Posted Over 5 years ago by Henning Koch.

A JavaScript error in an E2E test with Selenium will not cause your test to fail. This may cause you...

Ruby: How to use prepend for cleaner monkey patches

Posted Over 5 years ago by Emanuel.

Let's say you have a gem which has the following module: module SuperClient def self.foo 'Foo' end

How to write a good changelog

Posted Over 5 years ago by Emanuel.
keepachangelog.com

We want to keep a changelog for all gems we maintain. There are some good practices for writing a changelog...

How to make changes to a Ruby gem (as a Rails developer)

Posted Almost 6 years ago by Dominik Schöler.

At makandra, we've built a few gems over the years. Some of these are quite popular: spreewald (> 1M downloads...

Haml: Generating a unique selector for an element

Posted Almost 6 years ago by Henning Koch.

Having a unique selector for an element is useful to later select it from JavaScript or to update a fragment...