[CLI] Theme app extension : error when 'npm run dev'

Solved
thibautreg
Shopify Partner
5 1 2

Hey!

 

I've created a simple app with the CLI and node by doing :

- npm init @Shopify/app@latest

- npm run generate extension (theme app extension)

 

When I run 'npm run dev' I get this error that I don't understand ⬇️

 

My setup:

"@shopify/app": "3.44.1"

- "@shopify/cli": "3.44.1"

- MacBook M1 - Ventura 13.2.1

- Ruby 3.2.1

 

── external error ──────────────────────────────────────────────────────────────────

Error coming from `bundle install`

Command failed with exit code 5: bundle install
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/byebug-11.1.3/ext/byebug
/Users/thibaut/.asdf/installs/ruby/3.0.0/bin/ruby -I /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/3.0.0 -r
./siteconf20230301-67927-j4hpol.rb extconf.rb
creating Makefile

current directory: /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/byebug-11.1.3/ext/byebug
make "DESTDIR=" clean

current directory: /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/byebug-11.1.3/ext/byebug
make "DESTDIR="
compiling breakpoint.c
compiling byebug.c
compiling context.c
compiling locker.c
compiling threads.c
linking shared-object byebug/byebug.bundle
ld: warning: ignoring file /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/libruby.3.0.dylib, building for macOS-x86_64 but
attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
  "_rb_ary_detransient", referenced from:
      _eval_expression in breakpoint.o
  "_rb_ary_entry", referenced from:
      _find_breakpoint_by_pos in breakpoint.o
      _find_breakpoint_by_method in breakpoint.o
      _Contexts in byebug.o
      _Start in byebug.o
      _Stop in byebug.o
      _raise_event in byebug.o
      _load_backtrace in context.o
      ...
  "_rb_ary_new", referenced from:
      _Breakpoints in byebug.o
      _Contexts in byebug.o
      _Start in byebug.o
      _load_backtrace in context.o
  "_rb_ary_new_from_args", referenced from:
      _find_breakpoint_by_pos in breakpoint.o
      _find_breakpoint_by_method in breakpoint.o
  "_rb_ary_push", referenced from:
      _Contexts in byebug.o
      _Start in byebug.o
      _load_backtrace in context.o
  "_rb_cObject", referenced from:
      _Init_byebug_breakpoint in breakpoint.o
      _Init_byebug_context in context.o
      _Init_threads_table in threads.o
  "_rb_cThread", referenced from:
      _Contexts in byebug.o
      _Init_byebug_context in context.o
  "_rb_check_type", referenced from:
      _find_breakpoint_by_pos in breakpoint.o
      _find_breakpoint_by_method in breakpoint.o
      _brkpt_initialize in breakpoint.o
      _brkpt_enabled in breakpoint.o
      _brkpt_set_enabled in breakpoint.o
      _brkpt_expr in breakpoint.o
      _brkpt_set_expr in breakpoint.o
      ...
  "_rb_data_object_wrap", referenced from:
      _brkpt_create in breakpoint.o
      _byebug_context_create in context.o
      _context_dup in context.o
      _create_threads_table in threads.o
  "_rb_debug_inspector_backtrace_locations", referenced from:
      _load_backtrace in context.o
  "_rb_debug_inspector_frame_binding_get", referenced from:
      _load_backtrace in context.o
  "_rb_debug_inspector_frame_class_get", referenced from:
      _load_backtrace in context.o
  "_rb_debug_inspector_frame_self_get", referenced from:
      _load_backtrace in context.o
  "_rb_debug_inspector_open", referenced from:
      _raise_event in byebug.o
      _byebug_context_create in context.o
      _open_debug_inspector_ensure in context.o
  "_rb_define_alloc_func", referenced from:
      _Init_byebug_breakpoint in breakpoint.o
  "_rb_define_class_under", referenced from:
      _Init_byebug_breakpoint in breakpoint.o
      _Init_byebug_context in context.o
      _Init_threads_table in threads.o
  "_rb_define_method", referenced from:
      _Init_byebug_breakpoint in breakpoint.o
      _Init_byebug_context in context.o
  "_rb_define_module", referenced from:
      _Init_byebug in byebug.o
  "_rb_define_module_function", referenced from:
      _Init_byebug in byebug.o
      _Init_threads_table in threads.o
  "_rb_define_singleton_method", referenced from:
      _Init_byebug_context in context.o
  "_rb_eArgError", referenced from:
      _brkpt_set_hit_condition in breakpoint.o
  "_rb_eRuntimeError", referenced from:
      _Contexts in byebug.o
      _Thread_context in byebug.o
      _Context_frame_binding in context.o
      _Context_frame_class in context.o
      _Context_frame_file in context.o
      _Context_frame_line in context.o
      _Context_frame_method in context.o
      ...
  "_rb_eTypeError", referenced from:
      _Add_catchpoint in byebug.o
  "_rb_ensure", referenced from:
      _call_with_debug_inspector in context.o
  "_rb_errinfo", referenced from:
      _Debug_load in byebug.o
  "_rb_error_arity", referenced from:
      _Debug_load in byebug.o
      _Context_frame_binding in context.o
      _Context_frame_class in context.o
      _Context_frame_file in context.o
      _Context_frame_line in context.o
      _Context_frame_method in context.o
      _Context_frame_self in context.o
      ...
  "_rb_fix2int", referenced from:
      _find_breakpoint_by_pos in breakpoint.o
      _brkpt_initialize in breakpoint.o
      _brkpt_set_hit_value in breakpoint.o
      _raise_event in byebug.o
      _trace_print in byebug.o
      _Context_frame_binding in context.o
      _Context_frame_class in context.o
      ...
  "_rb_funcall", referenced from:
      _Contexts in byebug.o
      _Stoppable in byebug.o
      _trace_print in byebug.o
      _Context_frame_file in context.o
      _Context_frame_line in context.o
      _Context_frame_method in context.o
      _Context_suspend in context.o
      ...
  "_rb_funcallv", referenced from:
      _eval_expression in breakpoint.o
      _open_debug_inspector_i in context.o
  "_rb_gc_mark", referenced from:
      _mark_breakpoint in breakpoint.o
      _context_mark in context.o
      _t_tbl_mark_keyvalue in threads.o
  "_rb_gc_writebarrier_unprotect", referenced from:
      _eval_expression in breakpoint.o
  "_rb_global_variable", referenced from:
      _Init_byebug in byebug.o
  "_rb_hash_aref", referenced from:
      _raise_event in byebug.o
  "_rb_hash_aset", referenced from:
      _Add_catchpoint in byebug.o
      _raise_event in byebug.o
  "_rb_hash_new", referenced from:
      _Start in byebug.o
  "_rb_hash_tbl", referenced from:
      _raise_event in byebug.o
  "_rb_id2name", referenced from:
      _brkpt_pos in breakpoint.o
      _trace_print in byebug.o
  "_rb_id2sym", referenced from:
      _brkpt_hit_condition in breakpoint.o
      _Context_stop_reason in context.o
  "_rb_intern", referenced from:
      _Context_stop_reason in context.o
  "_rb_intern2", referenced from:
      _Init_byebug_breakpoint in breakpoint.o
      _brkpt_hit_condition in breakpoint.o
      _brkpt_set_hit_condition in breakpoint.o
      _Init_byebug in byebug.o
      _Contexts in byebug.o
      _line_event in byebug.o
      _call_event in byebug.o
      ...
  "_rb_ivar_defined", referenced from:
      _raise_event in byebug.o
  "_rb_ivar_set", referenced from:
      _raise_event in byebug.o
  "_rb_load_protect", referenced from:
      _Debug_load in byebug.o
  "_rb_mKernel", referenced from:
      _eval_expression in breakpoint.o
  "_rb_mod_ancestors", referenced from:
      _raise_event in byebug.o
  "_rb_mod_name", referenced from:
      _find_breakpoint_by_method in breakpoint.o
      _raise_event in byebug.o
      _trace_print in byebug.o
  "_rb_num2int", referenced from:
      _trace_print in byebug.o
  "_rb_obj_class", referenced from:
      _raise_event in byebug.o
      _byebug_context_create in context.o
  "_rb_out_of_int", referenced from:
      _find_breakpoint_by_pos in breakpoint.o
      _find_breakpoint_by_method in breakpoint.o
      _Contexts in byebug.o
      _Start in byebug.o
      _Stop in byebug.o
      _raise_event in byebug.o
      _byebug_context_create in context.o
      ...
  "_rb_protect", referenced from:
      _find_breakpoint_by_pos in breakpoint.o
      _find_breakpoint_by_method in breakpoint.o
  "_rb_raise", referenced from:
      _brkpt_set_hit_condition in breakpoint.o
      _Add_catchpoint in byebug.o
      _Contexts in byebug.o
      _Thread_context in byebug.o
      _Context_frame_binding in context.o
      _Context_frame_class in context.o
      _Context_frame_file in context.o
      ...
  "_rb_sprintf", referenced from:
      _trace_print in byebug.o
  "_rb_st_clear", referenced from:
      _Contexts in byebug.o
  "_rb_st_foreach", referenced from:
      _t_tbl_mark in threads.o
      _release_lock in threads.o
  "_rb_st_free_table", referenced from:
      _t_tbl_free in threads.o
  "_rb_st_init_numtable", referenced from:
      _create_threads_table in threads.o
  "_rb_st_insert", referenced from:
      _Contexts in byebug.o
      _thread_context_lookup in threads.o
      _Lock in threads.o
  "_rb_st_lookup", referenced from:
      _thread_context_lookup in threads.o
      _Lock in threads.o
  "_rb_str_cmp", referenced from:
      _find_breakpoint_by_method in breakpoint.o
      _Context_suspend in context.o
      _is_living_thread in threads.o
  "_rb_str_dup", referenced from:
      _Add_catchpoint in byebug.o
  "_rb_str_intern", referenced from:
      _Context_frame_method in context.o
  "_rb_str_new_cstr", referenced from:
      _brkpt_pos in breakpoint.o
  "_rb_str_new_static", referenced from:
      _find_breakpoint_by_method in breakpoint.o
      _Context_suspend in context.o
      _is_living_thread in threads.o
  "_rb_string_value", referenced from:
      _brkpt_initialize in breakpoint.o
      _brkpt_set_expr in breakpoint.o
  "_rb_sym2id", referenced from:
      _brkpt_initialize in breakpoint.o
      _call_event in byebug.o
      _trace_print in byebug.o
  "_rb_thread_current", referenced from:
      _Current_context in byebug.o
      _Debug_load in byebug.o
      _Stoppable in byebug.o
      _line_event in byebug.o
      _call_event in byebug.o
      _return_event in byebug.o
      _end_event in byebug.o
      ...
  "_rb_thread_run", referenced from:
      _release_lock in threads.o
  "_rb_thread_stop", referenced from:
      _acquire_lock in threads.o
      _Lock in threads.o
  "_rb_thread_wakeup", referenced from:
      _Context_resume in context.o
  "_rb_to_id", referenced from:
      _brkpt_set_hit_condition in breakpoint.o
  "_rb_tracearg_binding", referenced from:
      _line_event in byebug.o
      _call_event in byebug.o
      _return_event in byebug.o
  "_rb_tracearg_defined_class", referenced from:
      _call_event in byebug.o
      _trace_print in byebug.o
  "_rb_tracearg_event", referenced from:
      _trace_print in byebug.o
  "_rb_tracearg_from_tracepoint", referenced from:
      _line_event in byebug.o
      _call_event in byebug.o
      _return_event in byebug.o
      _end_event in byebug.o
      _raw_call_event in byebug.o
      _raw_return_event in byebug.o
      _raise_event in byebug.o
      ...
  "_rb_tracearg_lineno", referenced from:
      _line_event in byebug.o
      _return_event in byebug.o
      _trace_print in byebug.o
  "_rb_tracearg_method_id", referenced from:
      _call_event in byebug.o
      _trace_print in byebug.o
  "_rb_tracearg_path", referenced from:
      _line_event in byebug.o
      _return_event in byebug.o
      _trace_print in byebug.o
  "_rb_tracearg_raised_exception", referenced from:
      _raise_event in byebug.o
  "_rb_tracearg_return_value", referenced from:
      _return_event in byebug.o
  "_rb_tracearg_self", referenced from:
      _call_event in byebug.o
  "_rb_tracepoint_disable", referenced from:
      _Stop in byebug.o
  "_rb_tracepoint_enable", referenced from:
      _Start in byebug.o
  "_rb_tracepoint_new", referenced from:
      _Start in byebug.o
  "_rb_warn", referenced from:
      _return_event in byebug.o
  "_ruby_xfree", referenced from:
      _brkpt_create in breakpoint.o
      _byebug_pop_from_locked in locker.o
      _byebug_remove_from_locked in locker.o
      _t_tbl_free in threads.o
  "_ruby_xmalloc", referenced from:
      _brkpt_create in breakpoint.o
      _byebug_context_create in context.o
      _context_dup in context.o
      _byebug_add_to_locked in locker.o
      _create_threads_table in threads.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [byebug.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/byebug-11.1.3 for
inspection.
Results logged to
/Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/extensions/arm64-darwin-22/3.0.0/byebug-11.1.3/gem_make.out

  /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/3.0.0/rubygems/ext/builder.rb:90:in `run'
  /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/3.0.0/rubygems/ext/builder.rb:42:in `block in make'
  /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/3.0.0/rubygems/ext/builder.rb:34:in `each'
  /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/3.0.0/rubygems/ext/builder.rb:34:in `make'
  /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:64:in `block in build'
  /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/3.0.0/tempfile.rb:317:in `open'
  /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:28:in `build'
  /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/3.0.0/rubygems/ext/builder.rb:156:in `build_extension'
  /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/3.0.0/rubygems/ext/builder.rb:190:in `block in build_extensions'
  /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/3.0.0/rubygems/ext/builder.rb:187:in `each'
  /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/3.0.0/rubygems/ext/builder.rb:187:in `build_extensions'
  /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/3.0.0/rubygems/installer.rb:821:in `build_extensions'
/Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.4.7/lib/bundler/rubygems_gem_installer.rb:72:in
`build_extensions'
/Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.4.7/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
/Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.4.7/lib/bundler/source/rubygems.rb:200:in
`install'
/Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.4.7/lib/bundler/installer/gem_installer.rb:54:in
`install'
/Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.4.7/lib/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.4.7/lib/bundler/installer/parallel_installer.rb:16
7:in
`do_install'
/Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.4.7/lib/bundler/installer/parallel_installer.rb:15
8:in
`block in worker_pool'
  /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.4.7/lib/bundler/worker.rb:62:in `apply_func'
/Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.4.7/lib/bundler/worker.rb:57:in `block in
process_queue'
  /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.4.7/lib/bundler/worker.rb:54:in `loop'
  /Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.4.7/lib/bundler/worker.rb:54:in `process_queue'
/Users/thibaut/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.4.7/lib/bundler/worker.rb:90:in `block (2
levels) in create_threads'

An error occurred while installing byebug (11.1.3), and Bundler cannot continue.

In Gemfile:
  pry-byebug was resolved to 3.9.0, which depends on
    byebug
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Fetching rake 13.0.6
Installing rake 13.0.6
Using bundler 2.4.7
Using ansi 1.5.0
Using ast 2.4.2
Fetching concurrent-ruby 1.1.10
Using builder 3.2.4
Using coderay 1.1.3
Fetching public_suffix 4.0.6
Using colorize 0.8.1
Using rexml 3.2.5
Using cucumber-messages 17.1.1
Fetching ffi 1.15.4
Fetching cucumber-tag-expressions 3.0.1
Fetching cucumber-cucumber-expressions 12.1.3
Fetching diff-lcs 1.4.4
Fetching mime-types-data 3.2021.0901
Installing byebug 11.1.3 with native extensions
Installing cucumber-tag-expressions 3.0.1
Using multi_test 0.1.2
Fetching fakefs 1.3.2
Installing cucumber-cucumber-expressions 12.1.3
Installing public_suffix 4.0.6
Installing diff-lcs 1.4.4
Fetching faraday-em_http 1.0.0
Fetching faraday-em_synchrony 1.0.0
Installing mime-types-data 3.2021.0901
Installing concurrent-ruby 1.1.10
Fetching faraday-excon 1.1.0
Fetching faraday-httpclient 1.0.1
Installing faraday-em_http 1.0.0
Fetching multipart-post 2.1.1
Installing faraday-em_synchrony 1.0.0
Fetching faraday-net_http 1.0.1
Fetching faraday-net_http_persistent 1.2.0
Installing fakefs 1.3.2
Fetching faraday-patron 1.0.0
Installing faraday-excon 1.1.0
Fetching faraday-rack 1.0.0
Installing faraday-httpclient 1.0.1
Fetching faraday-retry 1.0.3
Installing multipart-post 2.1.1
Using ruby2_keywords 0.0.5
Using hashdiff 1.0.1
Using iniparse 1.5.0
Using liquid 5.4.0
Fetching rb-fsevent 0.11.1
Installing faraday-net_http 1.0.1
Using method_source 1.0.0
Fetching minitest 5.14.4
Installing faraday-net_http_persistent 1.2.0
Fetching ruby-progressbar 1.11.0
Installing ffi 1.15.4 with native extensions
Installing faraday-rack 1.0.0
Installing faraday-patron 1.0.0
Installing faraday-retry 1.0.3
Fetching mocha 1.13.0
Fetching parallel 1.21.0
Installing racc 1.6.2 with native extensions
Installing ruby-progressbar 1.11.0
Installing rb-fsevent 0.11.1
Installing minitest 5.14.4
Installing parallel 1.21.0
Fetching rack 2.2.3.1
Installing mocha 1.13.0
Using rainbow 3.1.1
Fetching regexp_parser 2.2.0
Fetching unicode-display_width 2.1.0
Fetching timecop 0.9.4
Using crack 0.4.5
Fetching cucumber-gherkin 20.0.1
Installing unicode-display_width 2.1.0
Fetching cucumber-html-formatter 16.0.1
Installing timecop 0.9.4
Fetching parser 3.2.0.0
Installing regexp_parser 2.2.0
Installing rack 2.2.3.1
Installing cucumber-gherkin 20.0.1
Fetching addressable 2.8.0
Fetching mime-types 3.3.1
Installing cucumber-html-formatter 16.0.1
Fetching bugsnag 6.24.2
Installing addressable 2.8.0
Installing mime-types 3.3.1
Installing bugsnag 6.24.2
Fetching faraday-multipart 1.0.3
Installing parser 3.2.0.0
Fetching pry 0.13.1
Using minitest-fail-fast 0.1.0
Fetching minitest-reporters 1.4.3
Installing faraday-multipart 1.0.3
Fetching cucumber-core 10.0.1
Fetching webmock 3.9.3
Installing cucumber-core 10.0.1
Fetching faraday 1.10.0
Installing pry 0.13.1
Installing minitest-reporters 1.4.3
Installing webmock 3.9.3
Installing faraday 1.10.0
Fetching rubocop-ast 1.15.1
Fetching cucumber-wire 6.1.1
Installing cucumber-wire 6.1.1
Installing rubocop-ast 1.15.1

 

Accepted Solution (1)
thibautreg
Shopify Partner
5 1 2

This is an accepted solution.

I found a solution :

- uninstall ruby

- install ruby with asdf

- manually install packages causing the error (4 in total):

An error occurred while installing byebug (11.1.3), and Bundler cannot continue.

by running "gem install byebug"

View solution in original post

Replies 2 (2)
thibautreg
Shopify Partner
5 1 2

This is an accepted solution.

I found a solution :

- uninstall ruby

- install ruby with asdf

- manually install packages causing the error (4 in total):

An error occurred while installing byebug (11.1.3), and Bundler cannot continue.

by running "gem install byebug"

SwiftDev
Shopify Partner
3 0 0

How do I fix it for window machine?