【问题标题】:Can't deploy with Capistrano - Issue with Capistrano rvm and bundlerCan't deploy with Capistrano - Capistrano rvm 和 bundler 的问题
【发布时间】:2019-12-08 22:51:59
【问题描述】:

大家好,感谢您的帮助,这是问题所在,我正在尝试使用 capistrano 部署一个网站,其中的 gems 和依赖项更新得太快了,所以我不得不更新这个网站的很多内容,但无论如何我尝试使用 Bundle exec cap 生产部署进行部署时,我是否总是遇到此错误。我使用的是 AWS EC2 Ubuntu 16.04 服务器

我已经重新安装了 bundler,重新安装了 ruby​​,重新启动了我的终端,capistrano/rvm 和 capistrano/bundler 已添加并在 Capfile 上是必需的

00:11 bundler:install
      01 ~/.rvm/bin/rvm  do bundle install --path /home/web/apps/catalog/shared/bundle --jobs 4 --without development test --deployment --quiet
#<Thread:0x00000000017b12a8@/home/ubuntu/.rvm/gems/ruby-2.5.3@catalogIndustry/gems/sshkit-1.19.1/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
        1: from /home/ubuntu/.rvm/gems/ruby-2.5.3@catalogIndustry/gems/sshkit-1.19.1/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
/home/ubuntu/.rvm/gems/ruby-2.5.3@catalogIndustry/gems/sshkit-1.19.1/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as web@ec2-52-15-226-151.us-east-2.compute.amazonaws.com: bundle exit status: 1 (SSHKit::Runner::ExecuteError)
bundle stdout: `rvm do bundle install --path /home/web/apps/catalog/shared/bundle --jobs 4 --without development test --deployment --quiet` was removed, use `rvm 1.9.2,1.9.3 do bundle install --path /home/web/apps/catalog/shared/bundle --jobs 4 --without development test --deployment --quiet` or `rvm all do bundle install --path /home/web/apps/catalog/shared/bundle --jobs 4 --without development test --deployment --quiet` instead.

bundle stderr: Nothing written
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as web@ec2-52-15-226-151.us-east-2.compute.amazonaws.com: bundle exit status: 1
bundle stdout: `rvm do bundle install --path /home/web/apps/catalog/shared/bundle --jobs 4 --without development test --deployment --quiet` was removed, use `rvm 1.9.2,1.9.3 do bundle install --path /home/web/apps/catalog/shared/bundle --jobs 4 --without development test --deployment --quiet` or `rvm all do bundle install --path /home/web/apps/catalog/shared/bundle --jobs 4 --without development test --deployment --quiet` instead.

bundle stderr: Nothing written


Caused by:
SSHKit::Command::Failed: bundle exit status: 1
bundle stdout: `rvm do bundle install --path /home/web/apps/catalog/shared/bundle --jobs 4 --without development test --deployment --quiet` was removed, use `rvm 1.9.2,1.9.3 do bundle install --path /home/web/apps/catalog/shared/bundle --jobs 4 --without development test --deployment --quiet` or `rvm all do bundle install --path /home/web/apps/catalog/shared/bundle --jobs 4 --without development test --deployment --quiet` instead.

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 web@ec2-52-15-226-151.us-east-2.compute.amazonaws.com: bundle exit status: 1
bundle stdout: `rvm do bundle install --path /home/web/apps/catalog/shared/bundle --jobs 4 --without development test --deployment --quiet` was removed, use `rvm 1.9.2,1.9.3 do bundle install --path /home/web/apps/catalog/shared/bundle --jobs 4 --without development test --deployment --quiet` or `rvm all do bundle install --path /home/web/apps/catalog/shared/bundle --jobs 4 --without development test --deployment --quiet` instead.

bundle stderr: Nothing written


** DEPLOY FAILED
** Refer to log/capistrano.log for details.

我还能做些什么来解决此错误并部署网站?

【问题讨论】:

  • 尝试:进入你的应用程序文件夹并捆绑安装
  • 捆绑完成! 77 个 Gemfile 依赖项,现在安装了 183 个 gem。未安装组测试中的宝石。使用 bundle info [gemname] 查看捆绑 gem 的安装位置。但它说同样的错误
  • 对不起,我忘了告诉你,在生产环境中捆绑安装
  • 我做了,还没有,看不出问题出在哪里

标签: ruby-on-rails capistrano


【解决方案1】:

Capistrano 似乎无法确定正确的 RVM ruby 版本。你可以用手点一下

# deploy.rb 
set :rvm_ruby_version, '2.5.3'
# or if you have single ruby version
set :rvm_ruby_version, 'default'

【讨论】:

    猜你喜欢
    • 2011-09-19
    • 1970-01-01
    • 2023-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多