最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

macos - Unity detects wrong ruby versions and cannot install cocoapods - Stack Overflow

programmeradmin4浏览0评论

Unity 2021.3.45f

IOS Resolver tries to install cocoapods. I have updated ruby version to 3.4.0, but Unity keeps to searching for 2.6.0. How to fix it?

Path:

export PATH="$HOME/.gem/ruby/3.4.0/bin:$PATH"
export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
export GEM_HOME="$HOME/.gem"
export GEM_PATH="$HOME/.gem"
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

IOS Resolver:

gem install cocoapods --user-install' failed with code (1):

WARNING: You don't have /Users/User/.gem/ruby/2.6.0/bin in your PATH, gem executables will not run. ERROR: Error installing cocoapods: The last version of drb (>= 0) to support your Ruby & RubyGems was 2.0.6. Try installing it with gem install drb -v 2.0.6 and then running the current command again drb requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210.

gem env:

RubyGems Environment:
  - RUBYGEMS VERSION: 3.6.3
  - RUBY VERSION: 3.4.2 (2025-02-15 patchlevel 28) [arm64-darwin23]
  - INSTALLATION DIRECTORY: /Users/User/.gem
  - USER INSTALLATION DIRECTORY: /Users/User/.gem/ruby/3.4.0
  - CREDENTIALS FILE: /Users/User/.local/share/gem/credentials
  - RUBY EXECUTABLE: /opt/homebrew/opt/ruby/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /Users/User/.gem/bin
  - SPEC CACHE DIRECTORY: /Users/User/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /opt/homebrew/Cellar/ruby/3.4.2/etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - arm64-darwin-23
  - GEM PATHS:
     - /Users/User/.gem
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => true
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - /
  - SHELL PATH:
     - /opt/homebrew/opt/ruby/bin
     - /Users/User/.gem/ruby/3.4.0/bin
     - /opt/homebrew/bin
     - /opt/homebrew/sbin
     - /usr/local/bin
     - /System/Cryptexes/App/usr/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
     - /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
     - /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
     - /Library/Apple/usr/bin
     - /Library/Frameworks/Mono.framework/Versions/Current/Commands

Unity 2021.3.45f

IOS Resolver tries to install cocoapods. I have updated ruby version to 3.4.0, but Unity keeps to searching for 2.6.0. How to fix it?

Path:

export PATH="$HOME/.gem/ruby/3.4.0/bin:$PATH"
export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
export GEM_HOME="$HOME/.gem"
export GEM_PATH="$HOME/.gem"
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

IOS Resolver:

gem install cocoapods --user-install' failed with code (1):

WARNING: You don't have /Users/User/.gem/ruby/2.6.0/bin in your PATH, gem executables will not run. ERROR: Error installing cocoapods: The last version of drb (>= 0) to support your Ruby & RubyGems was 2.0.6. Try installing it with gem install drb -v 2.0.6 and then running the current command again drb requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210.

gem env:

RubyGems Environment:
  - RUBYGEMS VERSION: 3.6.3
  - RUBY VERSION: 3.4.2 (2025-02-15 patchlevel 28) [arm64-darwin23]
  - INSTALLATION DIRECTORY: /Users/User/.gem
  - USER INSTALLATION DIRECTORY: /Users/User/.gem/ruby/3.4.0
  - CREDENTIALS FILE: /Users/User/.local/share/gem/credentials
  - RUBY EXECUTABLE: /opt/homebrew/opt/ruby/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /Users/User/.gem/bin
  - SPEC CACHE DIRECTORY: /Users/User/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /opt/homebrew/Cellar/ruby/3.4.2/etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - arm64-darwin-23
  - GEM PATHS:
     - /Users/User/.gem
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => true
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems./
  - SHELL PATH:
     - /opt/homebrew/opt/ruby/bin
     - /Users/User/.gem/ruby/3.4.0/bin
     - /opt/homebrew/bin
     - /opt/homebrew/sbin
     - /usr/local/bin
     - /System/Cryptexes/App/usr/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
     - /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
     - /var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
     - /Library/Apple/usr/bin
     - /Library/Frameworks/Mono.framework/Versions/Current/Commands
Share Improve this question asked Feb 16 at 0:52 OleOle 151 silver badge4 bronze badges 1
  • Would highly recommend a ruby version manager, rvm, rbenv, asdf, chruby, etc. This will make managing ruby versions and installing ruby dependent gems and libraries much easier in the future. – engineersmnky Commented Feb 17 at 15:03
Add a comment  | 

1 Answer 1

Reset to default 1

I have used zsh. Looks like Unity uses bash. In terminal, Settings / General / Shells open with change to bin/bash. Quit and restart terminal. gem install cocoapods, gem install drb -v 2.0.6, gem install activesupport -v 6.1.7.8, gem install cocoapods. Open Unity, get successful build.xx

发布评论

评论列表(0)

  1. 暂无评论