Posts
Rake without loading Rails
With a simple change, you can avoid loading Rails when running
bin/rake
but still keepbin/rails
working.Regex anchors in Ruby and PostgreSQL
Regular expressions (regex) in Ruby and PostgreSQL differ in a slightly confusing way when it comes to the meaning of
/Z
.Use ERB in your .rspec file to skip requiring byebug on CI
You might already be using RSpec’s
.rspec
file to avoid having to add therequire 'spec_helper'
line at the top of all your spec files.Database migration strategies
Most web applications use a database to persist state. Since the database is separate from the application and changes cannot be made to both simultaneously, there are various strategies for keeping them in sync.
Silencing tzinfo-data Bundler warnings
If you’ve ever created a new Rails app and then ran
bundle install
on a Unix-like system, you’ve probably seen this warning:The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run bundle lock –add-platform mingw, mswin, x64_mingw, jruby.
subscribe via RSS