Github Actions 使用系统 ruby 而不是 rbenv 版本

问题描述 投票:0回答:1

此操作在 macstadium runner 上运行 fastlane,rbenv 设置为使用 2.7.x,但 github 操作继续使用 2.6.x 我已经尝试卸载/重新安装 rbenv。

给出此错误消息:

Warning: the running version of Bundler (2.2.31) is older than the version that created the lockfile (2.4.22). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.4.22`.
Ignoring digest-crc-0.6.4 because its extensions are not built. Try: gem pristine digest-crc --version 0.6.4
Ignoring unf_ext-0.0.8.2 because its extensions are not built. Try: gem pristine unf_ext --version 0.0.8.2
Fetching gem metadata from https://rubygems.org/.......
drb-2.2.1 requires ruby version >= 2.7.0, which is incompatible with the current
version, ruby 2.6.10p210
which ruby
/Users/administrator/.rbenv/shims/ruby
which bundle
/Users/administrator/.rbenv/shims/bundle
ruby -v
ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [arm64-darwin23]
bundle env
Bundler       2.4.22
  Platforms   ruby, arm64-darwin-23
Ruby          2.7.4p191 (2021-07-07 revision a21a3b7d23704a01d34bd79d09dc37897e00922a) [arm64-darwin-23]
  Full Path   /Users/administrator/.rbenv/versions/2.7.4/bin/ruby
  Config Dir  /Users/administrator/.rbenv/versions/2.7.4/etc
RubyGems      3.1.6
  Gem Home    /Users/administrator/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0
  Gem Path    /Users/administrator/.gem/ruby/2.7.0:/Users/administrator/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0
  User Home   /Users/administrator
  User Path   /Users/administrator/.gem/ruby/2.7.0
  Bin Dir     /Users/administrator/.rbenv/versions/2.7.4/bin
Tools         
  Git         2.39.3 (Apple Git-146)
  RVM         not installed
  rbenv       rbenv 1.3.0
  chruby      not installed

我的$路径

/Users/administrator/.rbenv/shims
/Users/administrator/.nvm/versions/node/v16.17.0/bin  
/opt/homebrew/bin /opt/homebrew/sbin 
/usr/local/bin 
/System/Cryptexes/App/usr/bin 
/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin 

工作流程文件

  deploy-ios:
    runs-on: [self-hosted, macOS, ARM64, macstadium]
    steps:
      - name: Use Node.js 20.x
        uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
        with:
          node-version: 20.x
      - name: Install Yarn Dependencies
        run: yarn install
      - name: Clean up and install pod dependencies
        run: yarn clean:ios

在package.json中

 "clean:ios": "yarn cache clean && yarn install && cd ios && rm -rf Pods && rm -rf Build && bundle update && bundle install && bundle exec pod install && cd .."```
react-native github-actions rbenv
1个回答
0
投票

[已解决]我刚刚在 $PATH 的顶部添加了 ~/.rbenv/shims:/Users/administrator/.rbenv/shims/ruby

© www.soinside.com 2019 - 2024. All rights reserved.