提问人:DadaArno 提问时间:11/15/2023 更新时间:11/15/2023 访问量:24
创建全新的 react native 应用程序时出错(MacBook Pro M1、MacOS 14.1)
Error while creating a brand new react native app (MacBook Pro M1, MacOS 14.1)
问:
我正在使用装有 macOS Sonoma 14.1 版的 Mac M1。
我正在尝试创建一个新的react native应用程序,但我遇到了这个错误:
✔ Downloading template
✔ Copying template
✔ Processing template
✖ Installing Ruby Gems
error Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/Users/arnaud/Projects/JournalClone/vendor/bundle/ruby/3.0.0/gems/json-2.6.3/ext/json/ext/generator
/Users/arnaud/.rvm/rubies/ruby-3.0.0/bin/ruby extconf.rb
creating Makefile
current directory:
/Users/arnaud/Projects/JournalClone/vendor/bundle/ruby/3.0.0/gems/json-2.6.3/ext/json/ext/generator
make DESTDIR\= sitearchdir\=./.gem.20231115-60112-w264l5
sitelibdir\=./.gem.20231115-60112-w264l5 clean
current directory:
/Users/arnaud/Projects/JournalClone/vendor/bundle/ruby/3.0.0/gems/json-2.6.3/ext/json/ext/generator
make DESTDIR\= sitearchdir\=./.gem.20231115-60112-w264l5
sitelibdir\=./.gem.20231115-60112-w264l5
compiling generator.c
linking shared-object json/ext/generator.bundle
ld: warning: -multiply_defined is obsolete
ld: warning: ignoring file
'/Users/arnaud/.rvm/rubies/ruby-3.0.0/lib/libruby.3.0.dylib': found architecture
'arm64', required architecture 'x86_64'
ld: Undefined symbols:
_rb_ary_entry, referenced from:
_cState_to_h in generator.o
_generate_json_array in generator.o
_rb_attr_get, referenced from:
_cState_aref in generator.o
_rb_cArray, referenced from:
_generate_json in generator.o
_rb_cFalseClass, referenced from:
_generate_json in generator.o
_json_object_i in generator.o
_rb_cFloat, referenced from:
_generate_json in generator.o
_generate_json in generator.o
_json_object_i in generator.o
_rb_cHash, referenced from:
_cState_from_state_s in generator.o
_mObject_to_json in generator.o
_mHash_to_json in generator.o
_mArray_to_json in generator.o
_mInteger_to_json in generator.o
_mFloat_to_json in generator.o
_mString_to_json in generator.o
...
_rb_cInteger, referenced from:
_generate_json in generator.o
_json_object_i in generator.o
_rb_cNilClass, referenced from:
_generate_json in generator.o
_json_object_i in generator.o
_rb_cObject, referenced from:
_Init_generator in generator.o
_rb_cString, referenced from:
_generate_json in generator.o
_json_object_i in generator.o
_rb_cSymbol, referenced from:
_generate_json in generator.o
_json_object_i in generator.o
_json_object_i in generator.o
_rb_cTrueClass, referenced from:
_generate_json in generator.o
_json_object_i in generator.o
_rb_check_convert_type, referenced from:
_cState_configure in generator.o
_rb_check_type, referenced from:
_cState_indent_set in generator.o
_cState_space_set in generator.o
_cState_space_before_set in generator.o
_cState_object_nl_set in generator.o
_cState_array_nl_set in generator.o
_cState_max_nesting_set in generator.o
_cState_depth_set in generator.o
...
_rb_check_typeddata, referenced from:
_cState_initialize in generator.o
_cState_init_copy in generator.o
_cState_init_copy in generator.o
_cState_indent in generator.o
_cState_indent_set in generator.o
_cState_space in generator.o
_cState_space_set in generator.o
...
_rb_class_name, referenced from:
_mString_to_json_raw in generator.o
_mString_to_json_raw_object in generator.o
_rb_class_new_instance, referenced from:
_cState_from_state_s in generator.o
_mObject_to_json in generator.o
_mHash_to_json in generator.o
_mArray_to_json in generator.o
_mInteger_to_json in generator.o
_mFloat_to_json in generator.o
_mString_to_json in generator.o
...
_rb_convert_type, referenced from:
_cState_configure in generator.o
_rb_data_typed_object_zalloc, referenced from:
_cState_s_allocate in generator.o
_rb_define_alias, referenced from:
_Init_generator in generator.o
_Init_generator in generator.o
_rb_define_alloc_func, referenced from:
_Init_generator in generator.o
_rb_define_class_under, referenced from:
_Init_generator in generator.o
_rb_define_method, referenced from:
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
...
_rb_define_module, referenced from:
_Init_generator in generator.o
_rb_define_module_under, referenced from:
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
...
_rb_define_singleton_method, referenced from:
_Init_generator in generator.o
_Init_generator in generator.o
_rb_eArgError, referenced from:
_cState_init_copy in generator.o
_rb_enc_associate, referenced from:
_mHash_to_json in generator.o
_mArray_to_json in generator.o
_mInteger_to_json in generator.o
_mFloat_to_json in generator.o
_mString_to_json in generator.o
_mTrueClass_to_json in generator.o
_mFalseClass_to_json in generator.o
...
_rb_enc_get, referenced from:
_generate_json_string in generator.o
_rb_enc_str_asciionly_p, referenced from:
_generate_json_string in generator.o
_rb_error_arity, referenced from:
_cState_initialize in generator.o
_mObject_to_json in generator.o
_mHash_to_json in generator.o
_mArray_to_json in generator.o
_mInteger_to_json in generator.o
_mFloat_to_json in generator.o
_mString_to_json in generator.o
...
_rb_ext_ractor_safe, referenced from:
_Init_generator in generator.o
_rb_float_value, referenced from:
_generate_json_float in generator.o
_rb_funcall, referenced from:
_cState_from_state_s in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_to_h in generator.o
_cState_to_h in generator.o
_cState_aref in generator.o
_cState_aref in generator.o
_cState_aref in generator.o
...
_rb_gc_register_mark_object, referenced from:
_Init_generator in generator.o
_Init_generator in generator.o
_rb_hash_aref, referenced from:
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
...
_rb_hash_aset, referenced from:
_cState_to_h in generator.o
_cState_to_h in generator.o
_cState_to_h in generator.o
_cState_to_h in generator.o
_cState_to_h in generator.o
_cState_to_h in generator.o
_cState_to_h in generator.o
_cState_to_h in generator.o
_cState_to_h in generator.o
_cState_to_h in generator.o
_cState_to_h in generator.o
_cState_to_h in generator.o
...
_rb_hash_foreach, referenced from:
_generate_json_object in generator.o
_rb_hash_new, referenced from:
_cState_to_h in generator.o
_mString_to_json_raw in generator.o
_mString_to_json_raw_object in generator.o
_rb_id2str, referenced from:
_json_object_i in generator.o
_rb_id2sym, referenced from:
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
_cState_configure in generator.o
...
_rb_intern, referenced from:
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
_Init_generator in generator.o
...
_rb_intern2, referenced from:
_cState_to_h in generator.o
_rb_iv_get, referenced from:
_cState_to_h in generator.o
_rb_ivar_set, referenced from:
_cState_aset in generator.o
_rb_obj_class, referenced from:
_mString_to_json_raw in generator.o
_mString_to_json_raw_object in generator.o
_rb_obj_is_kind_of, referenced from:
_cState_from_state_s in generator.o
_cState_from_state_s in generator.o
_mObject_to_json in generator.o
_mObject_to_json in generator.o
_mHash_to_json in generator.o
_mHash_to_json in generator.o
_mArray_to_json in generator.o
_mArray_to_json in generator.o
...
_rb_path2class, referenced from:
_Init_generator in generator.o
_Init_generator in generator.o
_generate_json_string in generator.o
_generate_json_string in generator.o
_generate_json_string in generator.o
_rb_raise, referenced from:
_cState_init_copy in generator.o
_generate_json_object in generator.o
_generate_json_array in generator.o
_generate_json_string in generator.o
_generate_json_float in generator.o
_rb_require, referenced from:
_Init_generator in generator.o
_rb_respond_to, referenced from:
_generate_json in generator.o
_rb_str_cat, referenced from:
_cState_aset in generator.o
_rb_str_concat, referenced from:
_cState_aref in generator.o
_cState_aset in generator.o
_rb_str_dup, referenced from:
_cState_aset in generator.o
_rb_str_export_to_enc, referenced from:
_generate_json_string in generator.o
_rb_str_intern, referenced from:
_cState_to_h in generator.o
_cState_aref in generator.o
_cState_aset in generator.o
_rb_str_new, referenced from:
_cState_indent in generator.o
_cState_space in generator.o
_cState_space_before in generator.o
_cState_object_nl in generator.o
_cState_array_nl in generator.o
_cState_to_h in generator.o
_cState_to_h in generator.o
_cState_to_h in generator.o
_cState_to_h in generator.o
_cState_to_h in generator.o
...
_rb_str_new_static, referenced from:
_cState_indent in generator.o
_cState_space in generator.o
_cState_space_before in generator.o
_cState_object_nl in generator.o
_cState_array_nl in generator.o
_cState_aref in generator.o
_cState_aset in generator.o
...
_rb_str_substr, referenced from:
_cState_to_h in generator.o
_rb_string_value_cstr, referenced from:
_cState_to_h in generator.o
_rb_string_value_ptr, referenced from:
_fbuffer_append_str in generator.o
_rb_sym2id, referenced from:
_cState_aref in generator.o
_cState_aset in generator.o
_json_object_i in generator.o
_rb_usascii_encoding, referenced from:
_generate_json_string in generator.o
_rb_utf8_encoding, referenced from:
_mHash_to_json in generator.o
_mArray_to_json in generator.o
_mInteger_to_json in generator.o
_mFloat_to_json in generator.o
_mString_to_json in generator.o
_mTrueClass_to_json in generator.o
_mFalseClass_to_json in generator.o
...
_ruby_xfree, referenced from:
_cState_indent_set in generator.o
_cState_indent_set in generator.o
_cState_space_set in generator.o
_cState_space_set in generator.o
_cState_space_before_set in generator.o
_cState_space_before_set in generator.o
_cState_object_nl_set in generator.o
_cState_object_nl_set in generator.o
...
_ruby_xmalloc, referenced from:
_cState_init_copy in generator.o
_cState_init_copy in generator.o
_cState_init_copy in generator.o
_cState_prepare_buffer in generator.o
_cState_prepare_buffer in generator.o
_cState_prepare_buffer in generator.o
_cState_prepare_buffer in generator.o
...
_ruby_xmalloc2, referenced from:
_cState_init_copy in generator.o
_cState_init_copy in generator.o
_cState_init_copy in generator.o
_cState_init_copy in generator.o
_cState_init_copy in generator.o
_cState_init_copy in generator.o
_cState_init_copy in generator.o
_cState_init_copy in generator.o
...
_ruby_xrealloc2, referenced from:
_cState_init_copy in generator.o
_cState_init_copy in generator.o
_cState_init_copy in generator.o
_mTrueClass_to_json in generator.o
_mFalseClass_to_json in generator.o
_mNilClass_to_json in generator.o
_cState_prepare_buffer in generator.o
_cState_prepare_buffer in generator.o
_cState_prepare_buffer in generator.o
_cState_prepare_buffer in generator.o
_cState_prepare_buffer in generator.o
_cState_prepare_buffer in generator.o
...
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [generator.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in
/Users/arnaud/Projects/JournalClone/vendor/bundle/ruby/3.0.0/gems/json-2.6.3 for
inspection.
Results logged to
/Users/arnaud/Projects/JournalClone/vendor/bundle/ruby/3.0.0/extensions/arm64-darwin-22/3.0.0/json-2.6.3/gem_make.out
/Users/arnaud/.rvm/rubies/ruby-3.0.0/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:120:in
`run'
/Users/arnaud/.rvm/rubies/ruby-3.0.0/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:53:in
`block in make'
/Users/arnaud/.rvm/rubies/ruby-3.0.0/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:45:in
`each'
/Users/arnaud/.rvm/rubies/ruby-3.0.0/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:45:in
`make'
/Users/arnaud/.rvm/rubies/ruby-3.0.0/lib/ruby/site_ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:42:in
`build'
/Users/arnaud/.rvm/rubies/ruby-3.0.0/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:188:in
`build_extension'
/Users/arnaud/.rvm/rubies/ruby-3.0.0/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:222:in
`block in build_extensions'
/Users/arnaud/.rvm/rubies/ruby-3.0.0/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:219:in
`each'
/Users/arnaud/.rvm/rubies/ruby-3.0.0/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:219:in
`build_extensions'
/Users/arnaud/.rvm/rubies/ruby-3.0.0/lib/ruby/site_ruby/3.0.0/rubygems/installer.rb:839:in
`build_extensions'
/Users/arnaud/.rvm/gems/ruby-3.0.0/gems/bundler-2.4.22/lib/bundler/rubygems_gem_installer.rb:76:in
`build_extensions'
/Users/arnaud/.rvm/gems/ruby-3.0.0/gems/bundler-2.4.22/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
/Users/arnaud/.rvm/gems/ruby-3.0.0/gems/bundler-2.4.22/lib/bundler/source/rubygems.rb:203:in
`install'
/Users/arnaud/.rvm/gems/ruby-3.0.0/gems/bundler-2.4.22/lib/bundler/installer/gem_installer.rb:54:in
`install'
/Users/arnaud/.rvm/gems/ruby-3.0.0/gems/bundler-2.4.22/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/Users/arnaud/.rvm/gems/ruby-3.0.0/gems/bundler-2.4.22/lib/bundler/installer/parallel_installer.rb:130:in
`do_install'
/Users/arnaud/.rvm/gems/ruby-3.0.0/gems/bundler-2.4.22/lib/bundler/installer/parallel_installer.rb:121:in
`block in worker_pool'
/Users/arnaud/.rvm/gems/ruby-3.0.0/gems/bundler-2.4.22/lib/bundler/worker.rb:62:in
`apply_func'
/Users/arnaud/.rvm/gems/ruby-3.0.0/gems/bundler-2.4.22/lib/bundler/worker.rb:57:in
`block in process_queue'
/Users/arnaud/.rvm/gems/ruby-3.0.0/gems/bundler-2.4.22/lib/bundler/worker.rb:54:in
`loop'
/Users/arnaud/.rvm/gems/ruby-3.0.0/gems/bundler-2.4.22/lib/bundler/worker.rb:54:in
`process_queue'
/Users/arnaud/.rvm/gems/ruby-3.0.0/gems/bundler-2.4.22/lib/bundler/worker.rb:90:in
`block (2 levels) in create_threads'
An error occurred while installing json (2.6.3), and Bundler cannot continue.
In Gemfile:
cocoapods was resolved to 1.14.2, which depends on
cocoapods-core was resolved to 1.14.2, which depends on
algoliasearch was resolved to 1.27.5, which depends on
json
✖ Installing Ruby Gems
error Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/environment-setup?os=macos&platform=android and follow the React Native CLI QuickStart guide for macOS and iOS.
节点版本:v18.18.2
NPM 版本:9.8.1
Ruby 版本:ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin22]
有人可以帮我解决这个问题吗?
答: 暂无答案
评论