创建React native cli项目Ruby时出错

dauxcl2d  于 2023-03-31  发布在  React
关注(0)|答案(1)|浏览(201)

As the image shows, I can't finish the generation because it shows an error in Ruby, but I already updated it and even so it doesn't work. It shows the difference between the folders.
Downloading template ✔ Copying template ✔ Processing template ✖ Installing Bundler error /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin22/rbconfig.rb:21: warning: Insecure world writable dir /Users/jcs/projetos in PATH, mode 040777 Your RubyGems version (3.0.3.1) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3 Your Ruby version is 2.6.10, but your Gemfile specified 2.7.6
✖ Installing Bundler error Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS. Error: Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS. at createFromTemplate (/usr/local/lib/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/init/init.js:131:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.initialize [as func] (/usr/local/lib/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/init/init.js:184:3) at async Command.handleAction (/usr/local/lib/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:106:9) info Run CLI with --verbose flag for more details. jcs@Junios-Mac-Studio projetos % ruby -v ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin22] jcs@Junios-Mac-Studio projetos %

I've tried almost everything

2hh7jdfx

2hh7jdfx1#

几天前,每当我试图创建一个React-Native CLI项目时,我都会遇到同样的错误,我认为这是因为系统中可用的Ruby版本不同。
首先,请在您的终端运行rvm list来检查您设备上安装的ruby版本。它显示了您系统中安装的ruby版本,还显示了哪个版本设置为默认值,哪个版本正在使用。
所以我的建议是,你要从你的系统中卸载ruby,然后尝试重新安装。我做了同样的事情,我的错误得到解决。
在这里,我附上了一个Youtube视频链接,我按照它安装了Ruby和Gems:https://youtu.be/wnZzWIKS0tY

相关问题