Question

Can't restart unicorn after cap deploy.

Posted July 15, 2014 4.3k views

I am trying to deploy an Rails app (unicorn, nginx).
Using:

require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
And tried to run after 'deploy:finished':
execute "cd #{release_path} && bundle exec unicorn -c #{release_path}/config/unicorn.rb -E #{fetch(:stage)} -D"

I get a

DEBUG[72b6d5f6] Command: bundle exec unicorn -c /home/mb/st/staging/releases/20140715135329/config/unicorn.rb -E staging -D
DEBUG[72b6d5f6]     bash: /usr/local/bin/bundle: /usr/bin/ruby1.8: bad interpreter: No such file or directory

Ubuntu 14.04 x84

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

3 answers

Do you mean to use Ruby 1.8? It’s pretty outdated. It also sounds like it isn’t installed. Try upgrading the system ruby or implementing rbenv/rvm.

Nope, i won’t use Ruby 1.8. In my droplet was 2.0 by default and i want use 2.0. I can’t understand why he trying to get Ruby 1.8. And also i use rvm.

rvm list
=* ruby-2.0.0-p353 [ x86_64 ]

don’t know why, but gem rdoc used Ruby 1.8.
sudo gem update - solved the problem

Submit an Answer