[英]install appropriate version of ruby-bundler with apt get in dockerfile
如何安裝與我嘗試將我的應用程序更新到的 Ruby 版本配套的適當捆綁程序版本?
dockerfile 中的上一個命令apt-get install -y ruby3.5 ruby3.5-dev ruby-bundler
修改 dockerfile apt-get install -y ruby3.6 ruby3.6-dev ruby-bundler
當我運行 dockerfile 並嘗試運行bundle install
時,我收到此錯誤。 我也不確定sprockets
錯誤是否是由於捆綁器已過時。
Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Fetching gem metadata from http://rubygems.org/............
Fetching version metadata from http://rubygems.org/...
Fetching dependency metadata from http://rubygems.org/..
You have requested:
sprockets = 3.0
The bundle currently has sprockets locked at 2.0
Try running `bundle update sprockets`
If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`
如果您需要更多控制,我建議您不要從 deb package 安裝它,而是通過gem install
。 就像是:
FROM <whatever>
ENV RUBYGEMS_VERSION=3.1.2 \
BUNDLER_VERSION=2.3.9
RUN apt-get update && \
apt-get -y install <prerequisites, ruby, ...> && \
gem update --system ${RUBYGEMS_VERSION} && \
gem install bundler --version ${BUNDLER_VERSION} \
...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.