Questions and discussions about using the Shopify CLI and Shopify-built libraries.
i installed
then i runed this commands
But when i running shopify theme dev --store=my-store
i logged in thene getting error why 😞
i am tried multiple times used chatGPT but error not fixed.
the error
C:\WebDev\Shopify\Theme\rup-rang>shopify theme dev ── 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: C:/Users/Ronak Giri Raj/AppData/Local/shopify-gems-nodejs/Cache/ruby/3.3.0/gems/ffi-1.16.3/ext/ffi_c C:/Ruby33-x64/bin/ruby.exe extconf.rb checking for pkg-config for libffi... not found checking for ffi.h... no checking for ffi.h in /usr/local/include,/usr/include/ffi,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi,/Applications/Xc ode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi... no checking for whether -Wl,--exclude-libs,ALL is accepted as LDFLAGS... yes checking for rb_gc_mark_movable()... yes checking for whether -pthread is accepted as LDFLAGS... yes creating extconf.h creating Makefile current directory: C:/Users/Ronak Giri Raj/AppData/Local/shopify-gems-nodejs/Cache/ruby/3.3.0/gems/ffi-1.16.3/ext/ffi_c make DESTDIR\= sitearchdir\=./.gem.20240601-7156-enga6p sitelibdir\=./.gem.20240601-7156-enga6p clean current directory: C:/Users/Ronak Giri Raj/AppData/Local/shopify-gems-nodejs/Cache/ruby/3.3.0/gems/ffi-1.16.3/ext/ffi_c make DESTDIR\= sitearchdir\=./.gem.20240601-7156-enga6p sitelibdir\=./.gem.20240601-7156-enga6p generating ffi_c-x64-mingw-ucrt.def /bin/sh: -c: line 1: syntax error near unexpected token `(' /bin/sh: -c: line 1: `mkdir -p "/c/Users/Ronak Giri Raj/AppData/Local/shopify-gems-nodejs/Cache/ruby/3.3.0/gems/ffi-1.16.3/ext/ffi_c/libffi-x64-mingw-ucrt" ""/c/Users/Ronak(D)"' make: *** [libffi.mk:6: "/c/Users/Ronak] Error 2 make failed, exit code 2 Gem files will remain installed in C:/Users/Ronak Giri Raj/AppData/Local/shopify-gems-nodejs/Cache/ruby/3.3.0/gems/ffi-1.16.3 for inspection. Results logged to C:/Users/Ronak Giri Raj/AppData/Local/shopify-gems-nodejs/Cache/ruby/3.3.0/extensions/x64-mingw-ucrt/3.3.0/ffi-1.16.3/gem_make.out C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/builder.rb:125:in `run' C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/builder.rb:51:in `block in make' C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/builder.rb:43:in `each' C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/builder.rb:43:in `make' C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/ext_conf_builder.rb:42:in `build' C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/builder.rb:193:in `build_extension' C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/builder.rb:227:in `block in build_extensions' C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/builder.rb:224:in `each' C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/ext/builder.rb:224:in `build_extensions' C:/Ruby33-x64/lib/ruby/3.3.0/rubygems/installer.rb:852:in `build_extensions' C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/rubygems_gem_installer.rb:76:in `build_extensions' C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/rubygems_gem_installer.rb:28:in `install' C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/source/rubygems.rb:206:in `install' C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/installer/gem_installer.rb:54:in `install' C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec' C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/installer/parallel_installer.rb:132:in `do_install' C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/installer/parallel_installer.rb:123:in `block in worker_pool' C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/worker.rb:62:in `apply_func' C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/worker.rb:57:in `block in process_queue' <internal:kernel>:187:in `loop' C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/worker.rb:54:in `process_queue' C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/worker.rb:90:in `block (2 levels) in create_threads' An error occurred while installing ffi (1.16.3), and Bundler cannot continue. In Gemfile: listen was resolved to 3.7.1, which depends on rb-inotify was resolved to 0.11.1, which depends on ffi Fetching gem metadata from https://rubygems.org/........... Resolving dependencies... Installing ffi 1.16.3 with native extensions
It looks like the error you're encountering when trying to run shopify theme dev is due to a failure in installing the ffi gem, a common Ruby library used to write Ruby extensions in C and to load dynamic libraries. The log indicates that the error arises because the ffi gem cannot find the required libffi library or its headers during installation.
Here are some steps to potentially resolve this issue on a Windows environment:
Install libffi: You need to ensure that libffi is installed and its headers are accessible. This might not be straightforward on Windows, as it often requires manually downloading or using a package manager like MSYS2 or Cygwin.
Configure Environment Variables: Ensure that Ruby can find the libffi headers and libraries. You may need to set the PKG_CONFIG_PATH environment variable to point to the directory containing libffi.pc. This is typically within the lib\pkgconfig folder inside your MSYS2 installation.
Install the ffi Gem Manually:
Run Bundle Install:
Retry Running the Shopify Theme Command:
If you continue to face issues, it may be useful to ensure that your development environment matches the expected setup for Shopify theme development, which often means aligning with the versions of Node.js, Ruby, and other dependencies that are known to be compatible. Additionally, checking for spaces or special characters in your directory paths might also help, as they can sometimes cause issues with Ruby gems and native extensions.
It works. not WSL2
- Windows11
- vscode(powershell)
- nodejs v20.14.0
- Ruby+Devkit 3.0.7-1 (x64)
|- MSYS2
|- base system(1,2,3)
- @Shopify/cli@3.60.0