'shopify theme dev' fails installing theme dependencies

I followed the Shopify CLI guideline for themes, as usual, and got stuck after the ‘shopify theme dev’. It should upload the current theme to a store so I can preview it, but, instead I get this error (here’s a snippet).

/opt/homebrew/Cellar/shopify-cli/3.43.0/libexec/lib/node_modules/@shopify/cli/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

ExternalError: Command failed with exit code 5: /opt/homebrew/opt/ruby/bin/bundle install
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

I am working on Mac OS Venutra, with Shopify 3.43.0 and node.js v19.6.0

Someone knows what is going on? This has happened all of a sudden

1 Like

hello there

The error message suggests that there is an issue with building the native extension for a gem, which may be causing the bundle install command to fail. Here are some troubleshooting steps you can try:

  1. Check if all the required dependencies for building the native extensions are installed on your system. Depending on the gem, you may need to have certain tools or libraries installed. You can check the gem’s documentation or the error message for more information.

  2. Try running bundle install directly in your theme directory to see if it produces a more informative error message.

  3. If the problem persists, you can try deleting the Gemfile.lock file in your theme directory and running bundle install again. This will force the bundler to rebuild the dependencies from scratch.

  4. You can also try updating your Ruby installation and installing the bundler gem, as the issue may be related to the version of Ruby or bundler.

Hello, when I run bundle install, give an error-Could not locate Gemfile.

2 Likes

I have the same error, did you find the solution?

Hello @claralayti

Did you find any solution for this? I am getting this same error.

Please help me if you find any solution.

Thank you!

2 Likes

I’m also getting this same error

I’m also getting same error

did you find any solution?

If you have found any solution, can you please share with me

Thank You

1 Like

For me, this did the trick…

Open Terminal and run

xcode-select --install

A popup dialogue box will open (Might be hidden behind other windows). Click “Install” and install the Command Line Tool Package.

If this doesn’t work, also run

sudo xcode-select --reset

(You don’t need to have Xcode installed to do all that)

you need to have Ruby installed. Go to the terminal and run

brew install ruby

after that run

brew tap shopify/shopify
brew install shopify-cli

to update to the latest cli.
If you are running into permission issues, run:

sudo chown -R 

replace <your-user-name> with your current OS user name