--deployment标志需要一个Gemfile.lock。在部署之前,请确保已将Gemfile.lock签入版本控制

--deployment标志需要一个Gemfile.lock。在部署之前,请确保已将Gemfile.lock签入版本控制,deployment,capistrano,bundler,Deployment,Capistrano,Bundler,我在服务器上使用Capistrano部署时遇到此错误,我已尝试解决此问题约3个小时,但未成功。此错误发生在cap运行bundle install时 executing "cd $HOME/releases/20130629113827 && bundle install --gemfile $HOME/releases/20130629113827/Gemfile --path $HOME/shared/bundle --deployment --quiet --without

我在服务器上使用Capistrano部署时遇到此错误,我已尝试解决此问题约3个小时,但未成功。此错误发生在cap运行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.
以下是我迄今为止取得的成果:

  • 服务器上同时存在Gemfile和Gemfile.lock
  • Gemfile.lock直接存在于应用程序根目录中(它不在文件夹或其他文件中)
  • “发布”文件夹在实际发布目录之外没有任何文件
  • 我将Gemfile中的所有gem与Gemfile.lock进行了比较,发现它们都存在
  • 我在scm中检查了我的Gemfile和Gemfile.lock,并且.bundle在忽略列表中
我不使用Capistrano中bundler的任何设置,所以我是否错过了设置或设置 什么


提前谢谢。问题是我的rails应用程序根目录位于另一个名为app的目录中,因此Capistrano在错误的目录中查找Gemfile。我只需将此添加到deploy.rb即可解决此问题:

set :bundle_gemfile, "app/Gemfile"

我希望这可以帮助任何有此问题的人。问题是我的rails应用程序根目录位于另一个名为app的目录中,因此Capistrano在错误的目录中查找Gemfile。我只需将此添加到deploy.rb即可解决此问题:

set :bundle_gemfile, "app/Gemfile"

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

如果您使用ssh连接到服务器,将cd插入应用程序目录,然后简单地执行
捆绑安装
,会发生什么?它仍然不起作用吗?如果您使用ssh连接到服务器,将cd插入应用程序目录,然后简单地执行
捆绑安装
,会发生什么情况?还是不行吗?