-
Notifications
You must be signed in to change notification settings - Fork 202
Conversation
Is it possible to add a Github check for brew install being successful prior to releases? I just went to install shopify-cli on a new Macbook Pro but am unable to, so I can't work on my project. Is there any way to install an older version or something to get around this issue until a fix is pushed? |
@binarymonkey84 we should definitely improve our CI, thanks. As a workaround while we release this, you can always install it via RubyGems: https://shopify.dev/apps/tools/cli/installation#install-shopify-cli |
Thanks for your reply! Yeah, I tried the Ruby Gems approach but this did not work on macOS. I get a permission denied error which according to a few other sources is what happens "out of the box" with macOS when trying to install a gem from Terminal. So unfortunately I can't run the gem command listed on the Shopify dev docs - is there some other step by need to take before I do this? And won't installing the CLI this way conflict with homebrew once that is working? |
Do you have an M1? You can try applying this change to |
system("#{ruby_bin}/gem", "fetch", "shopify-cli", "--version", gem_version) | ||
_, err, status = Open3.capture3("#{ruby_bin}/gem", "fetch", "shopify-cli", "--version", gem_version) | ||
unless status.success? | ||
odie err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -13,7 +13,7 @@ | |||
class ShopifyCli < Formula | |||
module RubyBin | |||
def ruby_bin | |||
Formula["ruby"].opt_bin | |||
Formula["ruby@3.0"].opt_bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably didn't see this on my system due to having Ruby 3.1 installed already. Thanks for fixing.
I've approved the PR. It will still take a bit until it's merged and released, so @binarymonkey84 if you're in a rush you can try The issue is that macOS comes bundled with Ruby but it's in a protected directory, Because we don't want to encourage overuse of |
Thanks for approving. I'm using an Intel Mac (I went for Intel hardware by choice to reduce compatibility issues). I was aware of the sudo option, but like you say it doesn't come recommended and from what I'd seen, the Internet seems to be saying "don't do that". I will have a look at rbenv, but not knowing anything about Ruby, I wasn't sure if this would mess up the system Ruby, homebrew or even if it worked, whether having the gem install method is compatible with the homebrew install method... It would probably be nice to update the Shopify docs to talk about this, or at least mention the preferred method is Homebrew (it's not first on the page). I remember the first time I tried to install the CLI on an Intel Mac with Ruby, it went very wrong indeed. When I tried homebrew there was no issue (until this problem of course). |
WHY are these changes introduced?
The changes in this PR broke the installation through Homebrew because the
def ruby_bin
method is trying to get the path to the Ruby binary from the wrong formula. I've updated it to read it from theruby@3.0
and taken the opportunity to improve installation errors.WHAT is this pull request doing?
Fix the template that we use to generate the formula at release time.
How to test your changes?
/opt/homebrew/Library/Taps/shopify/homebrew-shopify/shopify-cli.rb
.brew uninstall shopify-cli
.brew install shopify-cli
.Update checklist