-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gitops: TypeError: no implicit conversion of Hash into String #36
Comments
Hello @mjtrangoni this looks like you're running this on an old version of Ruby? The signature for the Might want to upgrade to a newer version of Ruby? |
Hi @bigkevmcd, Indeed, I was running ruby 2.6 and upgraded to ruby 3.1, but without any change. See, ruby --version
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [arm64-darwin23]
brew link --overwrite --force ruby
Linking /opt/homebrew/Cellar/ruby/3.2.2_1... 4185 symlinks created.
If you need to have this software first in your PATH instead consider running:
echo 'export PATH="/opt/homebrew/opt/ruby/bin:$PATH"' >> ~/.zshrc
brew install gitops
==> Fetching weaveworks/tap/gitops
==> Downloading https://github.com/weaveworks/weave-gitops/releases/download/v0.37.0/gitops-Darwin-arm64.tar.gz
Already downloaded: /Users/mtrangoni/Library/Caches/Homebrew/downloads/f49ca5e63c0ea4f1046fd40ca231f45d388b354026cdc60fdf251d2191f7c850--gitops-Darwin-arm64.tar.gz
==> Installing gitops from weaveworks/tap
Error: An exception occurred within a child process:
TypeError: no implicit conversion of Hash into String |
@mjtrangoni I think this is a change in Homebrew https://github.com/Homebrew/brew/releases/tag/4.1.23 |
Ruby 3 is stricter about kwargs: https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ The way to fix it is: diff --git a/Formula/gitops.rb b/Formula/gitops.rb
index 0ba1055..059fbe4 100644
--- a/Formula/gitops.rb
+++ b/Formula/gitops.rb
@@ -30,11 +30,11 @@ class Gitops < Formula
def install
bin.install "gitops"
# Install bash completion
- output = Utils.safe_popen_read({ "SHELL" => "bash" }, "#{bin}/gitops completion bash --no-analytics", { :err => :err })
+ output = Utils.safe_popen_read({ "SHELL" => "bash" }, "#{bin}/gitops completion bash --no-analytics", err: :err)
(bash_completion/"gitops").write output
# Install zsh completion
- output = Utils.safe_popen_read({ "SHELL" => "zsh" }, "#{bin}/gitops completion zsh --no-analytics", { :err => :err })
+ output = Utils.safe_popen_read({ "SHELL" => "zsh" }, "#{bin}/gitops completion zsh --no-analytics", err: :err)
(zsh_completion/"_gitops").write output
end
end (As a side note: is there a reason the install code is copy-pasted 4 times?) |
@Bo98 Thanks for that, I'll get a change made and hopefully that'll fix it! |
thanks @Bo98 for the suggestion 🙏 @mjtrangoni could you give it a try now? |
@enekofb it is working now. Thank you!
|
Nice, thanks for reporting it! |
@enekofb @bigkevmcd it seems the new release reverted your fix, see here Would it make sense to add a CI test for this? |
raised weaveworks/weave-gitops#4161 |
both CI and formula updated after v0.38 release |
Hi,
I am facing this issues while trying to install the gitops Formula in a zsh shell, and the following error appears.
Is it something already known?
The text was updated successfully, but these errors were encountered: