【问题标题】:Deploying ruby app to cloud foundry, rubygems failure将 ruby​​ 应用程序部署到云代工厂,rubygems 失败
【发布时间】:2020-10-07 03:24:01
【问题描述】:

我是红宝石的新手。我正在部署一个 ruby​​ 应用程序,它从 slack 中读取错误 id,向 jira 发送请求,并将响应发送到 slack 并返回错误详细信息。 将此应用程序部署到 Cloud Foundry 时遇到问题。我在用, Cloud Foundry 构建包版本:1.8.25 捆绑器 2.1.4 红宝石 2.7.0 红宝石 3​​.1.4.

我有一个 proc 文件,其中包含命令 bundle exec rackup config.ru -p $PORT,当我执行 cf push 时,我收到以下错误:

 OUT Creating build for app with guid 
   2020-10-06T23:06:57.72-0400 [API/2] OUT Updated app with guid  ({"state"=>"STARTED"})
   2020-10-06T23:06:58.00-0400 [STG/0] OUT Cell  creating container for instance 
   2020-10-06T23:06:58.38-0400 [STG/0] OUT Cell successfully created container for instance 
   2020-10-06T23:06:58.70-0400 [STG/0] OUT Downloading app package...
   2020-10-06T23:06:58.75-0400 [STG/0] OUT Downloaded app package (869K)
   2020-10-06T23:07:01.25-0400 [STG/0] OUT -----> Download go 1.12.4
   2020-10-06T23:07:12.96-0400 [STG/0] OUT /tmp/buildpackdownloads/234werwrwr9c73796ddef6bc0d ~
   2020-10-06T23:07:12.96-0400 [STG/0] OUT -----> Running go build supply
   2020-10-06T23:07:15.23-0400 [STG/0] OUT ~
   2020-10-06T23:07:15.23-0400 [STG/0] OUT -----> Ruby Buildpack version 1.8.25
   2020-10-06T23:07:15.23-0400 [STG/0] OUT -----> Supplying Ruby
   2020-10-06T23:07:15.24-0400 [STG/0] OUT -----> Installing bundler 2.1.4
   2020-10-06T23:07:15.24-0400 [STG/0] OUT        Download [https://url/dependencies/bundler/bundler-2.1.4-any-stack-df7bed89.tgz]
   2020-10-06T23:07:16.64-0400 [STG/0] OUT -----> Installing ruby 2.7.0
   2020-10-06T23:07:16.64-0400 [STG/0] OUT        Download [https:/URL/dependencies/ruby/ruby-2.7.0-linux-x64-cflinuxfs3-68cd2bae.tgz]
   2020-10-06T23:07:19.08-0400 [STG/0] OUT        **WARNING** A newer version of ruby is available in this buildpack. Please adjust your app to use version 2.7.1 instead of version 2.7.0 as soon as possible. Old versions of ruby are only provided to assist in migrating to newer versions.
   2020-10-06T23:07:21.18-0400 [STG/0] OUT -----> Update rubygems from 3.1.2 to 3.1.4
   2020-10-06T23:07:21.18-0400 [STG/0] OUT -----> Installing rubygems 3.1.4
   2020-10-06T23:07:21.18-0400 [STG/0] OUT        Download [https://URL/dependencies/rubygems/rubygems_3.1.4_linux_noarch_any-stack_b59c5e57.tgz]
   2020-10-06T23:07:22.40-0400 [STG/0] ERR /tmp/rubygems270167546/lib/rubygems/core_ext/kernel_require.rb:92:in `require': /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: version `OPENSSL_1_1_1' not found (required by /tmp/contents329128731/deps/0/ruby/lib/ruby/2.7.0/x86_64-linux/openssl.so) - /tmp/contents329128731/deps/0/ruby/lib/ruby/2.7.0/x86_64-linux/openssl.so (LoadError)
   2020-10-06T23:07:22.40-0400 [STG/0] ERR  from /tmp/rubygems270167546/lib/rubygems/core_ext/kernel_require.rb:92:in `require'
   2020-10-06T23:07:22.40-0400 [STG/0] ERR  from /tmp/contents329128731/deps/0/ruby/lib/ruby/2.7.0/openssl.rb:13:in `<top (required)>'
   2020-10-06T23:07:22.40-0400 [STG/0] ERR  from /tmp/rubygems270167546/lib/rubygems/core_ext/kernel_require.rb:92:in `require'
   2020-10-06T23:07:22.40-0400 [STG/0] ERR  from /tmp/rubygems270167546/lib/rubygems/core_ext/kernel_require.rb:92:in `require'
   2020-10-06T23:07:22.40-0400 [STG/0] ERR  from /tmp/rubygems270167546/lib/rubygems/specification.rb:2430:in `to_ruby'
   2020-10-06T23:07:22.40-0400 [STG/0] ERR  from /tmp/rubygems270167546/lib/rubygems/commands/setup_command.rb:401:in `install_default_bundler_gem'
   2020-10-06T23:07:22.40-0400 [STG/0] ERR  from /tmp/rubygems270167546/lib/rubygems/commands/setup_command.rb:174:in `execute'
   2020-10-06T23:07:22.40-0400 [STG/0] ERR  from /tmp/rubygems270167546/lib/rubygems/command.rb:325:in `invoke_with_build_args'
   2020-10-06T23:07:22.40-0400 [STG/0] ERR  from /tmp/rubygems270167546/lib/rubygems/command_manager.rb:178:in `process_args'
   2020-10-06T23:07:22.40-0400 [STG/0] ERR  from /tmp/rubygems270167546/lib/rubygems/command_manager.rb:148:in `run'
   2020-10-06T23:07:22.40-0400 [STG/0] ERR  from /tmp/rubygems270167546/lib/rubygems/gem_runner.rb:59:in `run'
   2020-10-06T23:07:22.40-0400 [STG/0] ERR  from setup.rb:41:in `<main>'
   2020-10-06T23:07:22.40-0400 [STG/0] OUT        **ERROR** 
   2020-10-06T23:07:22.40-0400 [STG/0] OUT        **ERROR** Unable to update rubygems: Could not install rubygems: exit status 1
   2020-10-06T23:07:22.42-0400 [STG/0] ERR Failed to compile droplet: Failed to run all supply scripts: exit status 15
   2020-10-06T23:07:22.44-0400 [STG/0] OUT Exit status 223

如果您需要任何其他信息,请告诉我。

在运行“捆绑安装”尝试安装 gems 时,出现此故障。

【问题讨论】:

  • 你用的是什么栈? cf stacks 的输出是什么。如果将 -s cflinuxfs3 添加到 cf push 命令或将 stack: cflinuxfs3 添加到 manifest.yml 会发生什么?
  • 当我做cf stacks时,我可以看到cflinuxfs2 & cflinuxfs3。
  • Hai @DanielMikusa,Container 现在已启动,但 ruby​​ 应用程序未启动。我要关闭这个。谢谢。

标签: ruby rubygems bundler cloud-foundry


【解决方案1】:

从提供的信息中并不完全清楚,但是这个错误:

2020-10-06T23:07:22.40-0400 [STG/0] ERR /tmp/rubygems270167546/lib/rubygems/core_ext/kernel_require.rb:92:in require': /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: version OPENSSL_1_1_1' 未找到(/tmp 需要/contents329128731/deps/0/ruby/lib/ruby/2.7.0/x86_64-linux/openssl.so) - /tmp/contents329128731/deps/0/ruby/lib/ruby/2.7.0/x86_64-linux/openssl .so(加载错误)

看起来您有一个需要在 cflinuxfs2 上使用 cflinuxfs3 的 buildpack。这两个堆栈有不同的 OpenSSL 版本,cflinuxfs3 有 1.1.1。

切换堆栈至少应该允许您跳过此错误。

cf push -s cflinuxfs3 或在 manifest.yml 中设置 stack: cflinuxfs3


对于它的价值,在我写这篇文章的时候,cflinuxfs2 已经很老了,而且不支持了。如果您使用的平台仍默认使用 cflinuxfs2 堆栈,甚至将其作为选项提供,您应该与您的平台运营团队讨论尽快升级。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-17
    • 2023-03-13
    相关资源
    最近更新 更多