"Ruby environment not found" when trying to create a node.js theme app extension

"Ruby environment not found" when trying to create a node.js theme app extension

emalueg
Shopify Partner
17 0 5

This is my first time building a shopify custom app.
I'm following the guide documented here:
https://shopify.dev/apps/getting-started/create

 

The first step was to run: 

 

npm init @shopify/app@latest


I chose 'node' as my platform.


When complete, if i run:

npm run dev

the app starts fine.

 

However, if i try creating a theme app extension, by running:

npm run generate extension

and choosing 'theme app extension', it creates the extension folder under my project.

If i run the application again (using the same run command as before), I receive an error:
emalueg_0-1674766788107.png


I'm not building a ruby project.  What am i missing or doing wrong?

Replies 8 (8)

ShopifyDevSup
Shopify Staff
1453 238 509

Hi @emalueg - thanks for getting in touch, this is for sure odd. My understanding is that Ruby is used as a dependency for many CLI based projects, even if you're running it through NPM. I'd recommend following the URL from the error message that's surfaced by the CLI and see if the issue is resolved after you've installed Ruby. 

 

If the error persists, please reach out in our repo for the CLI itself here by opening an issue and we can help you out further that way. Hope this helps!

 

Al | Shopify Developer Support 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Appifiny
Shopify Partner
166 2 54

Did you find the solution? I have a php based app and getting the same error.

Try the best recent order app for Shopify free for 7 days: https://apps.shopify.com/recently
emalueg
Shopify Partner
17 0 5

Unfortunately, "Install Ruby".
It doesn't seem right to me, but something in the CLI setup depends on Ruby...

Appifiny
Shopify Partner
166 2 54

Yeh unfortunately Ruby is a requirement for the CLI. It also needs to be 2.7 which is not available by default in most packages so it's a bit of a pain to install.

Ruby currently doesn't work at all on Win11 ARM64.

Theme extensions are pretty neat but uploading/updating them via GIT and running the validation on the Shopify's side would have been a better solution, oh well.

Try the best recent order app for Shopify free for 7 days: https://apps.shopify.com/recently
PrasannaK
Shopify Partner
2 0 0

Linux machine has Ruby 3.2.2 installed.

PrasannaK_0-1702625896796.png

 

However when executing Shopify CLI commands, it is not recognizing the version and is throwing an error.

PrasannaK_1-1702625904613.png

PrasannaK_0-1702625964682.png
Please help me in addressing this issue

Mayank_9
Shopify Partner
2 0 0

I'm also facing the same issue. I have installed the latest ruby version in my system and still it's not recognizing and throwing the same error

RemyOuji
Visitor
2 0 0

If you're using vscode, close the program, reopen it, then run ruby -v to verify that it's installed. Worse case scenario, restart system due to installing a new program.

fulo
Shopify Partner
1 0 0

according to the docs: https://shopify.dev/docs/themes/tools/cli/install

 

my issue was i needed to install, Ruby+Devkit 3.0, installed using [RubyInstaller for Windows](https://rubyinstaller.org/downloads/) (select the MSYS2 component and the MSYS2 base installation option)

 

'npm run dev' worked for me after downloading it