[英]Your Ruby version is 2.6.8, but your Gemfile specified 2.7.5
[英]Your Ruby version is 2.6.8, but your Gemfile specified 2.7.6 error while enabling new architecture on react-native iOS
我已經看過這篇文章
我在新的react-native
項目版本 0.71.1 上遇到了這個問題,同時為iOS
啟用了新架構
我已經完成了以下所有步驟
$ brew update
$ brew install ruby-build
$ brew install rbenv
$ rbenv install 2.7.6
$ rbenv global 2.7.6
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
當我運行ruby --version
我得到ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-darwin22]
這是在 iOS 上啟用新架構所需的正確 ruby 版本
但是當我運行bundle install && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
我仍然收到錯誤提示
Your Ruby version is 2.6.10, but your Gemfile specified 2.7.6
我還缺少什么?
我還在 react native 的 GitHub 回購中提出了這個問題。 這可能有助於理解我已經嘗試過的內容
我能夠通過運行bundle install --redownload
來解決我的問題。 它強制重新下載 gemfile 上的所有 gem,將它們分配給新的捆綁器
您的錯誤消息意味着您的 Gemfile 中指定的 Ruby 版本與您系統中安裝的 Ruby 版本不同。
請嘗試以下步驟來解決此問題:
如果問題仍然存在,請嘗試重新安裝所需版本的 Ruby 和相關依賴項。
Rbenv 文檔可以在項目文件夾中定義一個名為.ruby-version
文件。 也許你有這個文件,里面有一個特定的版本號。
此設置會覆蓋默認的 ruby 版本。
Rbenv-Repo 鏈接: https://github.com/rbenv/rbenv
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.