Issue #11469 has been updated by Brock Wilcox.


I traced through the places where this error is raised in ruby, and couldn't find any issues. Could you try on the latest trunk version in case this was inadvertently fixed elsewhere? Any further clues would be great.

----------------------------------------
Bug #11469: ArgumentError: wrong number of arguments (-1 for 1)
https://bugs.ruby-lang.org/issues/11469#change-55569

* Author: Niko Dziemba
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: 2.2.2
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
I got an exception saying `ArgumentError: wrong number of arguments (-1 for 1)`. Obviously, `-1` is not a valid number of arguments, so I consider this a bug.

Unfortunately, I could not find a way to reproduce the issue, but it happened multiple times with the same code. It does, however, work > 99% of the time. 

Since our app is not open source, I cannot share all the code. I can however provide the backtrace (attached, also see https://app.honeybadger.io/fault/43434/9dc7feb396670e289e920b514133175e)

The code looks something like:

~~~
# Post is an ActiveRecord model
Post.find_or_initialize_by(id: id).update!(
  post_id: post_id,
  user_id: user.id,
  payout: Money.new(100, 'USD')
)
~~~

I am sorry for the lack of useful information, if there is any way I can provide more, I am happy to do so.


---Files--------------------------------
backtrace.txt (3.74 KB)


-- 
https://bugs.ruby-lang.org/