The --deployment flag requires a Gemfile.lock. Please make sure you have checked your Gemfile.lock into version control before deploying

喜夏-厌秋 提交于 2019-12-13 21:21:43

问题


I get this error when i deploy with Capistrano on a server, I have tried to solve it for about 3 hours now unsuccessfully this errors happens when cap runs bundle install

executing "cd $HOME/releases/20130629113827 && bundle install --gemfile $HOME/releases/20130629113827/Gemfile --path $HOME/shared/bundle --deployment --quiet --without development test"
executing command
The --deployment flag requires a Gemfile.lock. Please make sure you have checked
your Gemfile.lock into version control before deploying.

Here is what i reached so far :

  • both Gemfile and Gemfile.lock exists on the server
  • Gemfile.lock exists in the application root directory directly (it's not inside a folder or something)
  • the releases folder doesn't have any files beside the actual releases directories
  • i compared all the gems in Gemfile with Gemfile.lock and they all exists
  • I have both my Gemfile and Gemfile.lock checked in the scm and .bundle is in the ignore list

I don't use any settings for bundler in Capistrano so did i miss a setting or something?

Thanks in advance


回答1:


I got it.The problem was that my rails application root directory is inside another directory called app so Capistrano was looking for Gemfile in a wrong directory i solved the simply by adding this to deploy.rb :

set :bundle_gemfile, "app/Gemfile"

I hope this can help anyone who have this problem



来源:https://stackoverflow.com/questions/17380027/the-deployment-flag-requires-a-gemfile-lock-please-make-sure-you-have-checked

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