You installed some gems that install a binary (like bundle, rake or rails) with code that only works with modern Rubygems versions You downgraded Rubygems to an older...

...use it anyway, learn the lessons we already learnt: Use a compatible Rubygems for Rails 2.3 on Ruby 1.8.7 Ruby 1.8.7 is not compatible with current Rubygems versions (> 2.0). Runnig...

...node version that is older than mine. Every time I wanted to run my rails dev server I was asked to check my yarn integrity: error Integrity check failed

+ "systemParams": "linux-x64-64", "modulesFolders": [ "node_modules" ], - "flags": [], + "flags": [ + "checkFiles" + ], "linkedModules": [], "topLevelPatterns": [ "@rails/webpacker@4.x", There were also changes in node_modules/node-sass/vendor/linux-x64-64/binding.node. After I switched to the "correct...

This note describes how to kick a user out of a Rails application after she hasn't requested an action for a while. Note that this is different from deleting...

...troublesome upgrade to 1.9.3 and go straight to 2.1. When trying to make a Rails app run on Ruby 1.9, you're likely to encounter several issues. Here are a...

Resque comes with its own dashboard (Resque server) that you can mount inside your Rails 3 application with #config/routes.rb: require 'resque/server' My::Application.routes.draw do # ... mount Resque::Server => '/resque' end

Here is how to do it without a server-side component (like a Rails application). Use JavaScript's navigator.language (real browsers and IE11+) and navigator.userLanguage (old IEs).

makandra dev
github.com

Shortener is a Rails Engine Gem that makes it easy to create and interpret shortened URLs on your own domain from within your Rails application. Once installed Shortener will generate...

makandra dev
github.com

...different take on what we're doing with ActiveType. Since it lives under the rails organization it might be part of Rails...

makandra dev
github.com

EdgeRider 0.3.0 adds support for Rails 4.1 and Ruby 2.1. It forward-ports ActiveRecord::Base.scoped to Rails...

robots.thoughtbot.com

Arel is a library that was introduced in Rails 3 for use in constructing SQL queries. Every time you pass a hash to where, it goes through Arel eventually. Rails...

makandra dev
github.com

Gem to get Rails 3's new ActiveRecord query interface (where, order) and the new scope syntax (chaining scope definitions) in Rails 2. You also get #to_sql for scopes...

github.com

The ancestry gem allows you to easily use tree structures in your Rails application. There is one somewhat unobvious pitfall to it: its way of applying the orphan_strategy which...

We have two redundant auto-failover FreeBSD load balancers for our Ruby on Rails hosting setup that are connected to the Internet backbone with a 10GE interface pipe. All...

...other components are redundant, too. Interested? See http://railscomplete.de

...Keep in mind that this will not affect processes that are invoked through the Rails console. Put the environment variables into the user's shell configuration (e.g., ~/.bashrc) if you...

...cleaner will take care of this. See How to set up database_cleaner for Rails with Cucumber and RSpec...

makandracards.com

With the new unpoly client side templates (available since 3.10) there's another way to substitute the ids of inserted...

If possible, make the autoloaded class static by moving it out of Rails' load path...

...require 'mathn' call (usually by wrapping Bundler.require) like this: # config/application.rb MathnWorkaround.intercept do Bundler.require(:default, Rails.env) if defined?(Bundler) # If you require "mathn" manually, put it inside this block. end

gist.github.com

Re-creating a complex ActiveRecord scenario quickly without setting up a full-blown Rails app can come in handy e.g. when trying to replicate a presumed bug in ActiveRecord with...

...to your site and still have the serialization of such objects in their session. Rails will then try to rebuild the user's session and raise an error out of...

makandra dev

If you use a form (or form fields) multiple times inside one view, Rails will generate the same id attributes for fields again. This card presents you with a way...

tableplus.io

...other schema names when working with a (legacy) application's database. Note that for Rails applications, dropping and recreating the database itself is usually fine in development. You can use...

...param is a string and you don't get the magic type casting that Rails would give you if it was an actual database column. E.g. when you set an...