Can't restart unicorn after cap deploy.

July 15, 2014 4.2k views

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

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

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

Have another answer? Share your knowledge.