Closed shaibt closed 1 year ago
Hi @shaibt , the problem is Ruby on your machine. I have the same problem and after a while ( I also found your message on shopify community too) I fixed it in this way:
I installed rbenv:
brew install rbenv ruby-build
download ruby 3.1.2 env with it
rbenv install 3.1.2
set the environment downloaded:
rbenv global 3.1.2
copying the init command printed by this:
rbenv init
and added to my profile. I am using zsh so:
cd ~
echo 'eval "$(rbenv init -)"' >> .zshrc
now If you try
ruby -v
you should find something like:
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]
You're almost ready :)
If you try
npm run deploy
you don't have the error anymore but there should be a missing gem
Bundler version 2.3.7 is not supported
What to try:
To update to the latest version of Bundler, run gem install bundler
so:
gem install bundler
and now you are ready to build and deploy.
npm run deploy
...
Running validation…
Pushing your code to Shopify…
✅ Success! Deployed to Shopify.
Summary:
• theme-block is deployed to Shopify but not yet live
...
I hope this will work for you too
Cheers, Mirko
Hi @shaibt, thanks for opening up an issue!
We've seen that error before on CLI2 as well. It often relates to nokogiri being installed on 1 system architecture, then copied to another.
Can you please try this:
theme-check
and nokogiri
with rm -rf /Users/***/Library/Caches/shopify-cli-nodejs/vendor
(replacing ***
with your username)Hi @amcaplan,
I can answer your question too. I had the same issue before and I completely removed my shopify-cli-nodejs
under the Caches folder, but the deploy command reinstalled the same dependencies.
Also, as you can see from @shaibt stack trace, its Cache folder has Ruby 2.6.0 in the path.
I know that Shopify CLI 2.x requires Ruby 2.7 or higher, and macOS has 2.6.0 installed by default. Could Ruby 2.7.0 be a requirement for Shopify CLI 3?
Note that based on this issue it may be that this is a problem with MacOS system Ruby not identifying its platform in the way a normally installed Ruby would. So it may be best to install another version of Ruby (ideally a modern one) using chruby
, rbenv
, etc., then delete the directory I mentioned before (to clear nokogiri from your system and force reinstall) and see if that resolves the issue for you.
If this is something that plagues many users, we'll need to think about updating our install instructions to insist that system Ruby not be used. We could also detect the use of system Ruby and warn users in the CLI itself.
/cc @pepicrft
Many thanks @mirkocesaro - I was able to build and deploy the extension. Only way I was able to solve this was to upgrade to newer Ruby version. Once that was done everything worked smoothly. The default ruby version installed (at least on my Mac) was 2.6 and had the platform ambiguity issue.
I think the solution @amcaplan suggested is worth while - but I'd check what default Ruby versions are shipped by default on which OSX versions. I am using Monterey but my Mac is at least 4 years old.
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
I have a similar issue.
Error coming from
bundle exec theme-check /Users/Tek/Documents/Sites/Shopify/kit-status/extensions/kit-status-check -C :theme_app_extension`
Command failed with exit code 1: bundle exec theme-check /Users/Tek/Documents/Sites/Shopify/kit-status/extensions/kit-status-check -C :theme_app_extension
bundler: failed to load command: theme-check (/usr/local/lib/ruby/gems/[ruby-version]/bin/theme-check)
/usr/local/lib/ruby/gems/[ruby-version]/gems/theme-check-1.15.0/lib/theme_check/tags.rb:158:in `block in
(\s+(with|#{Liquid::Render::FOR})\s+(#{Liquid::QuotedFragment}+))?
^^^^^
`
Please confirm that you have:
In which of these areas are you experiencing a problem?
Extension
Expected behavior
Built a simple theme app extension scaffold using the shopify cli. Here is the single app block liquid file in the project (
extensions/testing-tooling-ext/blocks/app-block.liquid
)Successful in creating app and connecting it to our app in the partners dashboard. Next step is to deploy but deploy fails.
Actual behavior
npm run deploy
(and alsonpm run build
) fail with this error:We are running Shopify CLI 3.1.0 installed using npm:
Also have on same machine "older" shopify CLI (I think installed through the VS Code liquid extension?)
One line that stood out from full error log (see below full stack):
Stack trace
Reproduction steps
npm run deploy/build
Operating System
OSX Montery on i7 MacbOok Pro
Shopify CLI version (check your project's
package.json
if you're not sure)3.1.0
Shell
bash
Node version (run
node -v
if you're not sure)v14.19.3
What language and version are you using in your application?
Node