gpt4 book ai didi

ruby - 无法使用 bundle 安装 gems

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

我正在从 Jenkins 管道内的 docker 文件旋转 docker 容器( Alpine 基地)。容器安装:ruby-rake and ruby-bundler我可以毫无问题地 bundle

我在这个 jenkins 管道中的工作目录有 Gemfile 和 Gemfile.lock
我尝试在此工作目录中运行 bundle install

当我尝试:

bundle install #running as a shell command in jenkins 

我得到:
`/` is not writable.
Bundler will use `/tmp/bundler/home/unknown' as your home directory temporarily.
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.

Resolving dependencies.............
Fetching rake 10.3.2

Retrying download gem from https://rubygems.org/ due to error (2/4): Errno::ENOENT No such file or directory @ rb_sysopen - /.gem/ruby/2.4.0/cache/rake-10.3.2.gem
Retrying download gem from https://rubygems.org/ due to error (3/4): Errno::ENOENT No such file or directory @ rb_sysopen - /.gem/ruby/2.4.0/cache/rake-10.3.2.gem
Retrying download gem from https://rubygems.org/ due to error (4/4): Errno::ENOENT No such file or directory @ rb_sysopen - /.gem/ruby/2.4.0/cache/rake-10.3.2.gem
Errno::ENOENT: No such file or directory @ rb_sysopen -
/.gem/ruby/2.4.0/cache/rake-10.3.2.gem
An error occurred while installing rake (10.3.2), and Bundler cannot continue.
Make sure that `gem install rake -v '10.3.2'` succeeds before bundling.

In Gemfile:
aws_account_utils was resolved to 0.1.4, which depends on
rake

我该怎么做才能安装 Gemfile 和 Gemfile.lock 的 Ruby gems?

最佳答案

看起来您无权访问 root,因此 bundler 正在使用另一个目录。

接下来发生的是您的用户无权访问正确的 gem 目录,因为它不存在!尝试运行 bundle config path NEW_PATH_HERE设置您的用户可以访问的适当目录。

或者,您可以指定一个新路径:bundle install --path /some/path

关于ruby - 无法使用 bundle 安装 gems,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50956406/

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