设置react native cli项目的问题



当我运行npx react-native projectname时,项目仅部分创建。

现在当我运行bundle install时,我得到:

1. Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

2. An error occurred while installing ffi (1.15.5), and Bundler cannot continue. Make sure that "gem install ffi -v '1.15.5' --source 'https://rubygems.org/'" succeeds before bundling.

Using atomos 0.1.3
Using bundler 2.1.4
Using claide 1.1.0
Using fuzzy_match 2.0.4
Using nap 1.1.0
Using netrc 0.11.0
Fetching ffi 1.15.5
Installing ffi 1.15.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: █████████████████████s/React
Native/uber/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.5/ext/ffi_c
█████████████████████/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0 -r ./siteconf20221129-56735-3mfz1o.rb
extconf.rb
checking for ffi_prep_closure_loc() in -lffi… no
checking for ffi_prep_closure_loc() in -llibffi… no
checking for ffi_prep_closure_loc() in -llibffi-8… no
checking for whether -Wl,--exclude-libs,ALL is accepted as LDFLAGS… no
checking for whether -pthread is accepted as LDFLAGS… yes
creating extconf.h
creating Makefile
current directory: █████████████████████React
Native/uber/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.5/ext/ffi_c
make "DESTDIR=" clean
current directory: █████████████████████React
Native/uber/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.5/ext/ffi_c
make "DESTDIR="
/bin/sh: -c: line 0: unexpected EOF while looking for matching
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** █████████████████████ Error 2
make failed, exit code 2
Gem files will remain installed in █████████████████████/React
Native/uber/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.5 for inspection.
Results logged to █████████████████████/React
Native/uber/vendor/bundle/ruby/2.7.0/extensions/arm64-darwin-21/2.7.0/ffi-1.15.5/gem_make.out
An error occurred while installing ffi (1.15.5), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.15.5' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
cocoapods was resolved to 1.11.3, which depends on
cocoapods-core was resolved to 1.11.3, which depends on
typhoeus was resolved to 1.4.0, which depends on
ethon was resolved to 0.16.0, which depends on
ffi

是的,我已经安装了ffi 1.15.5(下面的截图),但它仍然说我没有它

█████████████████████ gem install ffi -v '1.15.5' --source 'https://rubygems.org/ '
Building native extensions. This could take a while...
Successfully installed ffi-1.15.5
Parsing documentation for ffi-1.15.5
Done installing documentation for ffi after 0 seconds
1 gem installed

Ruby版本: ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [arm64-darwin21]

——版本:1.11.3

我印象深刻的是,开始一个项目是多么的困难。谁来帮帮我

尝试使用expo。https://docs.expo.dev/get-started/create-a-new-app/

npx create-expo-app my-app运行这将创建一个名为"my-app"的新应用。

或者你可以运行npx create-expo-app --template从一个starter应用开始。我喜欢用'Navigation (TypeScript)'。

expo链接将解释如何设置您的应用程序以及如何在模拟器中运行您的应用程序或在手机上使用expo go应用程序。这是一个很好的资源。

希望有帮助!

最新更新