I recently made a gemfile change, committed and pushed my changes, and ran a Capistrano deployment…which exploded in an enormous ball of fire on the server. Here’s what I saw in my deployment output:
1 2 3 4
… “Throw more dots, more dots, more dots, come on more dots. Ok, stop dots.” (Congrats if you get that reference.) …
1 2 3 4 5
Following the sage recommendation to view the error log, shown above, I opened my Unicorn error log and was greeted with this:
1 2 3
- Bundler 1.1.4
- Capistrano 2.12.0
It took me a minute of staring at the error to realize that Unicorn was starting from a newer release folder than the one Bundler was complaining about (if you didn’t notice that, look closely at the Unicorn log above and you’ll see it). What made this error more interesting was the fact that part of my Capistrano deployment includes removing old releases, and the path bundler was referencing didn’t exist anymore. Yowzer!
I figured it was time to go back and read the Unicorn Sandbox Documentation…and I’m glad I did. It turns out that when you’re using Capistrano, you need to explicitly set the path to the correct gemfile in the
Unicorn.conf. My Unicorn deployment template for this file is
Unicorn.rb.erb, and my fix looks like this:
1 2 3
If you aren’t using erb, you’ll need to change
<%= current_path %> to whatever is appropriate for your deployment configuration.