Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
66
Help us understand the problem. What is going on with this article?
@TOSHIMITSU_MIYACHI

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

More than 5 years have passed since last update.

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

66
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
boot-home
予防医療の分野で、ヘルスデータを分析しながら食事や運動の習慣化を支援するコーチングサービスを開発しております。

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
66
Help us understand the problem. What is going on with this article?