Skip to content
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

Wrong number of arguments for dump in 2.7.0 #555

Closed
MihaiOnSoftware opened this issue Dec 1, 2023 · 4 comments
Closed

Wrong number of arguments for dump in 2.7.0 #555

MihaiOnSoftware opened this issue Dec 1, 2023 · 4 comments

Comments

@MihaiOnSoftware
Copy link

MihaiOnSoftware commented Dec 1, 2023

In our code base we have a call to the gem that looks like this:

JSON.dump(timestamp: datetime.to_s, log_type: "generic", message: msg).concat("\n")

We end up calling that line indirectly in a spec with data that makes it into:

JSON.dump(timestamp: "12342", log_type: "generic", message: "test").concat("\n")

We just upgraded to 2.7.0 today and it leads to the following error from inside the JSON gem:

ArgumentError:
  wrong number of arguments (given 0, expected 1..3)
/usr/local/bundle/gems/json-2.7.0/lib/json/common.rb:614:in `dump'

Please let me know if you need any more information.

@MihaiOnSoftware MihaiOnSoftware changed the title Internal wrong number of arguments in 2.7.0 Wrong number of arguments for dump in 2.7.0 Dec 1, 2023
@MihaiOnSoftware
Copy link
Author

It seems that wrapping the arguments into a hash solves the issue:

JSON.dump({ timestamp: datetime.to_s, log_type: "generic", message: msg }).concat("\n")

If that's intentional it might make sense to include it in the compatibility changes

@MihaiOnSoftware
Copy link
Author

MihaiOnSoftware commented Dec 1, 2023

Fixed in #553

@jcoyne
Copy link

jcoyne commented Dec 4, 2023

Can that fix be released?

jcoyne added a commit to sul-dlss/sul-bento-app that referenced this issue Dec 4, 2023
jcoyne added a commit to sul-dlss/sul-bento-app that referenced this issue Dec 4, 2023
@hsbt
Copy link
Member

hsbt commented Dec 4, 2023

@jcoyne We need to another fix like #558. After that, I'll release the new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants