Capistrano could not locate Gemfile error on application deployment

倖福魔咒の 提交于 2019-12-10 13:03:42

问题


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!


回答1:


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


来源:https://stackoverflow.com/questions/24469015/capistrano-could-not-locate-gemfile-error-on-application-deployment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!