zat validate (and zat package) throws a "wrong number of arguments" error | Community
Skip to main content

zat validate (and zat package) throws a "wrong number of arguments" error

  • May 18, 2022
  • 3 replies
  • 0 views

Chris63

TLDR: it looks like the zendesk_apps_support/i18n.rb calls into that gem with the wrong number of arguments (I suspect the i18n gem is much newer than the zendesk_apps_support version is expecting)

 

When I run `zat validate` (or zat package) I get an error:

/Users/chrispellett/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/i18n-1.10.0/lib/i18n.rb:210:in `translate': wrong number of arguments (given 2, expected 0..1) (ArgumentError)
        from /Users/chrispellett/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/zendesk_apps_support-4.32.0/lib/zendesk_apps_support/i18n.rb:7:in `t'
        from /Users/chrispellett/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/zendesk_apps_support-4.32.0/lib/zendesk_apps_support/validations/requests.rb:38:in `insecure_http_requests_warning'
        from /Users/chrispellett/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/zendesk_apps_support-4.32.0/lib/zendesk_apps_support/validations/requests.rb:18:in `block in call'

[...snip...]

3 replies

Greg29
  • May 18, 2022

Hi again Chris! This particular error is a compatibility issue with Ruby 3.x.x and ZAT, and I see you're using 3.1.0. Or at least I think that's what I'm reading, since I don't even see 3.1.2 available with `rbenv install --list-all` ! Since ZAT is currently in maintenance mode, it's unlikely that this will be fixed, but I can run some tests and open a PR. For now, I recommend running with 2.7.0 locally if you want to use ZAT or you can switch over to ZCLI as I mentioned here.

Let me know if you have any other questions!


Chris63
  • Author
  • May 19, 2022

Thanks Greg. I was referring to this document that showed Ruby v3 in its examples: https://developer.zendesk.com/documentation/apps/zendesk-app-tools-zat/installing-and-using-the-zendesk-apps-tools/


Greg29
  • May 19, 2022
Thanks for pointing that out Chris! I reached out to the team that maintains ZAT and ZCLI to discuss whether we want to fix that in the ZAS gem or if we want update the docs to use an earlier version of Ruby. Or possibly something else, but I appreciate you letting us know about this!