- 部署标志需要一个Gemfile.lock。请确保您在部署之前已将Gemfile.lock检入版本控制 [英] The --deployment flag requires a Gemfile.lock. Please make sure you have checked your Gemfile.lock into version control before deploying

查看:577
本文介绍了 - 部署标志需要一个Gemfile.lock。请确保您在部署之前已将Gemfile.lock检入版本控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在服务器上部署Capistrano时,我收到这个错误,我已经尝试解决了大约3个小时,现在没有成功,这个错误发生在cap运行捆绑安装

 执行cd $ HOME / releases / 20130629113827&& bundle install --gemfile $ HOME / releases / 20130629113827 / Gemfile --path $ HOME / shared / bundle --deployment  - 安静 - 没有开发测试
执行命令
--deployment标志需要一个Gemfile.lock。请确保您在部署之前已将
您的Gemfile.lock检入版本控制。

这是我到目前为止所达到的目标:




  • 服务器上存在Gemfile和Gemfile.lock

  • Gemfile.lock直接存在于应用程序根目录中(它不在文件夹或其中) / li>
  • 发布文件夹在实际版本目录下没有任何文件

  • 我将Gemfile中的所有宝石与Gemfile.lock进行了比较,它们都存在

  • 我的Gemfile和Gemfile.lock都在scm中被检入,而.bundle在忽略列表中。



我不会在Capistrano中使用任何设置来绑定,所以我错过了一个设置或
的某些东西?



提前感谢

解决方案

我得到了它的问题是我的rails应用程序根目录位于另一个名为app的目录中,所以Capistrano正在寻找Gemfile错误目录我解决了简单的添加到deploy.rb:

  set:bundle_gemfileapp / Gemfile

我希望这可以帮助任何有这个问题的人


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

解决方案

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

这篇关于 - 部署标志需要一个Gemfile.lock。请确保您在部署之前已将Gemfile.lock检入版本控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆