84
67

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rubyのエラーメッセージwrong number of arguments (a for b)の意味

Last updated at Posted at 2015-05-12

rubyを実行したときのエラーメッセージ
wrong number of arguments (1 for 0)
とか
wrong number of arguments (4 for 2)
とかどういう意味なんだろ、って検索してもあまりぴしゃりとしたのなかったので、投稿したくなった

結論から言うと、

wrong number of arguments (a for b)
a=呼び出し側の引数の数
b=メソッド側の引数の数

でしたわ。これがずれていると、エラーでる。一致させよう。

qiita.jpg

84
67
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
84
67

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?