Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capistrano could not locate Gemfile error on application deployment

I'm trying to deploy my Rails application to production server and I decided to deploy it to DigitalOcean using this guide + RVM.

To deploy I use following command:

cap production deploy

However, it fails at some part requiring gemfile. Here's the log of failed deployment:

DEBUG[323dfd0e] Command: cd /home/deploy/zwiadowcy/releases/20140628164657 && ~/.rvm/bin/rvm default do bundle install --binstubs /home/deploy/zwiadowcy/shared/bin --path
/home/deploy/zwiadowcy/shared/bundle --without development test --deployment --quiet
DEBUG[323dfd0e]     Could not locate Gemfile
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host my_ip_address: bundle exit status: 10
bundle stdout: Nothing written
bundle stderr: Nothing written

My gemfile already contains all required things:

gem 'capistrano', '~> 3.1.0'
gem 'capistrano-bundler', '~> 1.1.2'
gem 'capistrano-rails', '~> 1.1.1'
gem 'capistrano-rvm', github: "capistrano/rvm"

I've googled half of the Internet and tried many things, looked through many questions here and I'm now at the point that I don't really know what to do so I kindly ask you for help. Thanks!

like image 707
xShivan Avatar asked Jun 28 '14 16:06

xShivan


1 Answers

Verify that Gemfile and Gemfile.lock are checked in Git. For example you could run:

git log Gemfile
git log Gemfile.lock

You can also verify that those files are present in /home/deploy/zwiadowcy/releases/20140628164657 on the server.

Running manually the command in the server also helps:

cd /home/deploy/zwiadowcy/releases/20140628164657 && ~/.rvm/bin/rvm default do bundle install --binstubs /home/deploy/zwiadowcy/shared/bin --path /home/deploy/zwiadowcy/shared/bundle --without development test --deployment
like image 125
Ingo Claro Avatar answered Sep 21 '22 18:09

Ingo Claro