【问题标题】:Rails and capistrano deployment: bundle stderr: Nothing writtenRails 和 capistrano 部署:捆绑标准错误:没有写
【发布时间】:2015-03-30 17:30:17
【问题描述】:

我想用 capistrano3 推送一个 Rails4 应用程序。 但是当我尝试时,我得到了这些错误:

INFO [c7c799a8] Running /containers/30054/.rvm/bin/rvm 2.0.0-p598 do bundle install --path /containers/30054/sites/myapp/shared/bundle --without development test --deployment --quiet as user@MYSERVER
DEBUG [c7c799a8] Command: cd /containers/30054/sites/myapp/releases/20150330171635 && ( RVM_BIN_PATH=/containers/30054/.rvm/bin /containers/30054/.rvm/bin/rvm 2.0.0-p598 do bundle install --path /containers/30054/sites/myapp/shared/bundle --without development test --deployment --quiet )
DEBUG [c7c799a8]    You are trying to install in deployment mode after changing
DEBUG [c7c799a8]    your Gemfile. Run `bundle install` elsewhere and add the
DEBUG [c7c799a8]    updated Gemfile.lock to version control.
DEBUG [c7c799a8]    
DEBUG [c7c799a8]    You have deleted from the Gemfile:
DEBUG [c7c799a8]    * capistrano (~> 3.3.0)
DEBUG [c7c799a8]    * capistrano-bundler (~> 1.1.2)
DEBUG [c7c799a8]    * capistrano-rails (~> 1.1)
DEBUG [c7c799a8]    * capistrano-rvm
DEBUG [c7c799a8]    * capistrano3-puma
DEBUG [c7c799a8]    * mysql2 (~> 0.3.11)
DEBUG [c7c799a8]    * puma
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as user@MYSERVER: bundle exit status: 16
bundle stdout: You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

You have deleted from the Gemfile:
* capistrano (~> 3.3.0)
* capistrano-bundler (~> 1.1.2)
* capistrano-rails (~> 1.1)
* capistrano-rvm
* capistrano3-puma
* mysql2 (~> 0.3.11)
* puma
bundle stderr: Nothing written

SSHKit::Command::Failed: bundle exit status: 16
bundle stdout: You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

You have deleted from the Gemfile:
* capistrano (~> 3.3.0)
* capistrano-bundler (~> 1.1.2)
* capistrano-rails (~> 1.1)
* capistrano-rvm
* capistrano3-puma
* mysql2 (~> 0.3.11)
* puma
bundle stderr: Nothing written

Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as user@MYSERVER: bundle exit status: 16
bundle stdout: You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

You have deleted from the Gemfile:
* capistrano (~> 3.3.0)
* capistrano-bundler (~> 1.1.2)
* capistrano-rails (~> 1.1)
* capistrano-rvm
* capistrano3-puma
* mysql2 (~> 0.3.11)
* puma
bundle stderr: Nothing written

在我的 deploy.rb 中,我没有特定任务,我的 SCM 确实包含 Gemfile 和 Gemfile.lock。

有什么问题?

【问题讨论】:

    标签: ruby-on-rails ruby capistrano3


    【解决方案1】:

    您似乎更改了 Gemfile,但没有在本地机器上运行 bundle install。 所以你的 Gemfile 和 Gemfile.lock 不同步了。

    在本地机器上运行 bundle install 来更新 Gemfile.lock,然后提交并推送更改。

    【讨论】:

    • 我忘了提到这一点:我已经尝试过,并且两者都完美地版本化/推送。
    • 如果我是你,我会将服务器上的 Gemfile.lock 与本地 Gemfile.lock 进行比较。可能是一些 capistrano/git 问题。
    • 服务器上的 Gemfile.lock 和本地机器上没有区别。我在谷歌上搜索,找不到任何有用的东西。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-03
    • 1970-01-01
    • 2016-10-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多