ruby-on-rails-3capistrano

The --deployment flag requires a Gemfile.lock


I have spent couple of hours but unable to solve this problem.

When I try to deploy my local rails app to production server using capistrano I get the below error:

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

Any idea on how to solve this?

My rails application folder is under version control using Git. I have pushed the local git repo to github and the Gemfile.lock is there on github. So it is under version control. However capistrano continues to give the same error.

Deploy.rb file: https://gist.github.com/brahmadpk/4748991


Solution

  • Make sure there is nothing in the releases folder that is not a release. See this comment on a bundler issue for more details.

    This blogpost titled Capistrano Deployment Trouble explains the same issue.

    EDIT TO INCLUDE CONCLUSION FROM DISCUSSION IN COMMENTS

    The deploy_to param was not set to an absolute path; hence capistrano wasn't able to find the folder to deploy, causing this error message.