gpt4 book ai didi

ruby - Gitlab dpl 问题与 ruby​​ 版本

转载 作者:行者123 更新时间:2023-12-04 00:53:37 28 4
gpt4 key购买 nike

我有一个通过 Gitlab 部署的节点应用程序。我正在使用 docker 镜像 node:12.8.0 .
最近部署失败,出现以下错误

 $ dpl --provider=heroku --app=$HEROKU_DEVELOPMENT_APP --api-key=$HEROKU_API_KEY --skip-cleanup
Installing deploy dependencies
ERROR: Error installing dpl-heroku:
    faraday requires Ruby version >= 2.4.
Successfully installed multipart-post-2.1.1
Successfully installed ruby2_keywords-0.0.2
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- dpl/provider/heroku (LoadError)
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /var/lib/gems/2.3.0/gems/dpl-1.10.15/lib/dpl/provider.rb:93:in `rescue in block in new'
    from /var/lib/gems/2.3.0/gems/dpl-1.10.15/lib/dpl/provider.rb:68:in `block in new'
    from /var/lib/gems/2.3.0/gems/dpl-1.10.15/lib/dpl/cli.rb:41:in `fold'
    from /var/lib/gems/2.3.0/gems/dpl-1.10.15/lib/dpl/provider.rb:67:in `new'
    from /var/lib/gems/2.3.0/gems/dpl-1.10.15/lib/dpl/cli.rb:31:in `run'
    from /var/lib/gems/2.3.0/gems/dpl-1.10.15/lib/dpl/cli.rb:7:in `run'
    from /var/lib/gems/2.3.0/gems/dpl-1.10.15/bin/dpl:5:in `'
    from /usr/local/bin/dpl:22:in `load'
    from /usr/local/bin/dpl:22:in `'
Running after_script
00:01
Running after script...
$ echo "Job - $CI_JOB_NAME ended."
Job - deploy_development ended.
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1
我无法通过 apt-get install ruby2.4 安装 Ruby2.4 .
任何意见,将不胜感激。
谢谢

最佳答案

我今天在 Gitlab CI 中遇到了同样的问题。
问题是 Node 使用 debian stretch (version 9)默认情况下作为 docker 镜像的基础,至少在 12.x LTS 版本中是这样。这个版本的debian有Ruby 2.3.3 by default in the repositories ,法拉第不支持,需要a version equal to or greater than 2.4 .
我所做的是使用 12.x-buster 标签(注意版本标签末尾的 -buster),在这些 docker 镜像中,Node 使用 debian buster(版本 10)作为基础。这个版本的debian有Ruby 2.5.5 repositories by default ,它允许安装法拉第,因此 heroku 的 dpl 正常工作。

关于ruby - Gitlab dpl 问题与 ruby​​ 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64422105/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com