捆绑安装无法加载此类文件

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

当我在项目中尝试使用捆绑安装或 RCT_NEW_ARCH_ENABLED=1 捆绑执行 pod 安装时,出现此错误。 M2 芯片上的 Mac

/opt/homebrew/opt/ruby/bin/bundle:25:in `load': cannot load such file -- /opt/homebrew/Cellar/ruby/3.3.3/lib/ruby/gems/3.3.0/gems/bundler-2.5.15/exe/bundle (LoadError)
        from /opt/homebrew/opt/ruby/bin/bundle:25:in `<main>'

我已经重新安装了gem,但没有帮助: 我的红宝石版本:

ruby 3.3.3 (2024-06-12 revision f1c7b6f435) [arm64-darwin23]
/opt/homebrew/opt/ruby/bin/ruby
/opt/homebrew/opt/ruby/bin/gem
gem list bundler 

*** LOCAL GEMS ***

bundler (default: 2.5.15)

.zpfo文件:

eval "$(/opt/homebrew/bin/brew shellenv)"

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home

export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
exportPATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools

if [ -d "/opt/homebrew/opt/ruby/bin" ]; then
  export PATH=/opt/homebrew/opt/ruby/bin:$PATH
  export PATH=`gem environment gemdir`/bin:$PATH
fi
ruby react-native bundle bundler
1个回答
0
投票

我今天遇到了同样的问题,是我安装了多个版本的 Bundler。

我跑了,

gem uninstall bundler --all --force && gem install bundler
,它解决了我的问题。

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