Installing RubyGems for Ruby 1.8.6
Ruby 1.8.6 is incompatible with newer RubyGems releases; RubyGems 1.4.2 remains the last version that installs successfully.
Legacy CarrierWave: How to generate versions with different file extensions
CarrierWave can create versions with fixed extensions like mp4, but it needs custom uploader logic to keep filenames, MIME types, and cache handling consistent.
Mailcatcher: An alternative to inaction_mailer
Local email capture for Rails development avoids lost test messages and lets sent mail be viewed in a browser via MailCatcher.
JSONP - Wikipedia
Cross-origin web pages cannot normally communicate, but <script> requests can pull executable JavaScript around same-origin limits. JSONP uses this loophole to load dynamic data from other origins.
Debugging failed AJAX requests with better_errors
better_errors adds enhanced development error pages with a live REPL, and /__better_errors lets you inspect exceptions from AJAX requests.
travisliu/traim: Resource-oriented microframework for RESTful APIs
Build a RESTful API for ActiveRecord models with very little code. Traim emits a Rack application that can run standalone or inside Rails, but the 1:1 resource model can become limiting.
Unpoly: Passing Data to Compilers
Rails data can be passed to Unpoly compilers through data-* for simple strings and up-data for objects, arrays, and nested values.
nginx: How to drop connections for a location
return 444 makes nginx close a connection without sending a response, useful for rejecting specific routes or simulating dropped requests behind a reverse proxy.
Git: See all unpushed commits or commits that are not in another branch
Local commits missing from a remote or upstream branch are easy to identify with git cherry -v, which lists the commits not shared by both branches.
Carrierwave: Custom file validations inside custom Uploaders
MIME type checks can live in a CarrierWave uploader instead of every mounted model, keeping file-type validation centralized and raising CarrierWave::IntegrityError for bad uploads.
Rails 7.1: Take care of the new production log default to standard out
Rails 7.1 changes production logging to standard out, which can break file-based logs in opscomplete setups unless the previous logger configuration is restored.
Execution of shell code in Ruby scripts
Deprecated Ruby ways to run shell commands can be unsafe or behave differently; capture3 is the preferred option for new code.
PostgreSQL cheat sheet for MySQL lamers
Quick PostgreSQL command equivalents for MySQL users switching databases, listing tables, managing roles and privileges, and loading dumps.
Tearing Down Capybara Tests of AJAX Pages
Pending AJAX requests can die when a Capybara test ends or switches scenarios, causing flaky JavaScript specs. Waiting for the page to load helps avoid the failure.
Heads up: Deployment with newly generated SSH key (using ED25519) might fail
Capistrano deployments can fail with ED25519 SSH keys when ed25519 and bcrypt_pbkdf are missing, and host key fingerprints may need refreshing after the switch.
defunkt/jquery-pjax
pjax loads HTML into the current page without a full reload, preserving permalinks, page titles, and back-button behavior with graceful fallback.
Let the browser choose the protocol
Protocol-dependent links break mixed-content embeds and tests; protocol-relative URLs let the browser pick http or https from the page context.
How to disable logging for ActiveStorage's Disk Service routes
ActiveStorage disk-service requests can clutter development logs with redundant route, record-load, and URL-generation messages. Selective silencing keeps Rails output readable.
Exclude your staging site from Google with robots.txt and not shoot yourself in the foot
Staging sites can be kept out of Google with robots.txt while avoiding a forgotten block on launch by serving a separate exclude file on staging only.
Cucumber: Wait for any requests to finish before moving on to the next scenario
Selenium/Cucumber scenarios can finish before browser requests and redirects are done, leaving the session busy and breaking later steps and hooks.
When Date.today and Date.tomorrow return the same day...
Date.today and Date.tomorrow can return the same day when Rails has no configured time zone, causing date handling to drift between UTC and local time.
Creating a Rails application in a single file
Running Rails in one file is useful for quick experiments, debugging bugs, or embedding an app in tests, but version and dependency drift can cause surprises.
Rails 4.1+: New locale files require a Spring restart
Rails 4.1 development can ignore newly added I18n YAML files because Spring caches the load path; restarting Spring makes new translations appear.
VCR: Alternative way of mocking remote APIs
VCR records real HTTP interactions and replays them from YAML, making network-dependent tests run offline without manual stubs.