The buzz cut

Ramblings from the barbershop

Upgrading to Rails 4.0: Binstubs

| Comments

This will be one of many followup posts to my Upgrading Rails 3.2 to Rails 4.0 post. This post assumes a working Rails 4 app, albeit one that’s still using the backward compatibility gems.

But before I get to those gems, I wanted to add binstubs so that the rails, rake, bundle, and rspec binaries would be part of my app. Binstubs are not new to Rails 4, but using them is a strong Rails 4, or at least a strong DHH, opinion.

1
2
bundle exec rake rails:update:bin
bundle binstubs rspec-core

Now I had a bin/ directory, populated with the binaries I just mentioned. Instead of running “bundle exec rake”, I can now use “bin/rake”. I then added the binstubs to my git ignore:

git add .gitignore bin/ “`

Easy enough. Now, on to removing the backward compatability gems. I’ll start with strong parameters and work my way down the list.

Comments