Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Shopify Theme Dev gets ruby: invalid switch in RUBYOPT: -F (RuntimeError)

Shopify Theme Dev gets ruby: invalid switch in RUBYOPT: -F (RuntimeError)

rpk1000
Shopify Partner
3 0 0

Hello,

 

I am just getting started with CLI. I want to learn how to create custom themes and am following the steps here:

https://shopify.dev/docs/storefronts/themes/getting-started/create

 

Everything went as expected until I reached "Step 2: Start a local development server". When I run the command shopify theme dev --store {store-name} with my development store name replacing {store-name}, I get the following error: 

 

ruby: invalid switch in RUBYOPT: -F (RuntimeError)

 

I've tried using just the store name, storename.myshopify.com, and https://storename.myshopify.com, all to no avail.

 

I don't know anything about RUBY and Google has turned up little-to-nothing helpful outside of updating the bundler to the latest version.

 

Any ideas or help would be greatly appreciated.

Replies 3 (3)

Liam
Community Manager
3108 344 904

What version of Ruby do you currently have installed on your machine? It should be version 2.7.5 or higher.

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me 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

rpk1000
Shopify Partner
3 0 0

Hi Liam,

 

Thanks for replying.

 

I'm running 3.3.4. Here's the output: ruby 3.3.4 (2024-07-09 revision be1089c8ec) [x64-mingw-ucrt]

 

Robb

rpk1000
Shopify Partner
3 0 0

It's amazing what a few hours of sleep will do.

 

I found a solution first thing in a tab I had open on my browser from last night. I was just about to close it, when I caught the title of the search result.

 

Turns out to be user error, as expected. I installed Ruby in the C:\Program Files folder instead of C:. The extra space in Program Files was causing the error. I ran a complete uninstall and re-install and the issue is resolved.

 

Liam, thanks again for your quick reply.

 

Robb