0

我正在尝试在 openShift 上部署我的 rails 应用程序,一切都很好,但它会警告包更新。

Warning: the running version of Bundler (1.16.1) is older than the version that created the lockfile (1.16.6). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.

我想更新 openshift bundler 或其他方式来克服这个问题。

4

1 回答 1

1

通常,运行过期bundler不会导致任何问题,因此您应该能够安全地忽略警告。

但是,如果bundler由于某种原因必须更新 的版本,则应在默认构建过程之前使用.s2i/bin/assemble脚本来更新 的版本。bundler所以类似于

#!/bin/bash -e
# The assemble script builds the application artifacts from source and
# places them into appropriate directories inside the image.

echo "---> Updating bundler gem..."
gem install bundler

# Execute the default S2I script
source ${STI_SCRIPTS_PATH}/assemble

应该做的伎俩。如果您将其.s2i/bin作为可执行assemble脚本添加到目录中的存储库(定义不要忘记chmod +x assemble在将其添加到存储库之前),这应该会为您解决问题。

您还可以在GitHub 存储库中查看默认的 Ruby 2.5assemble脚本: https ://github.com/sclorg/s2i-ruby-container/blob/master/2.5/s2i/bin/assemble 。如果您好奇,只需根据需要更改 URL 中的版本。sclorg

于 2019-03-29T16:40:37.697 回答