I tried to explain how to quickly check the error sentences that often appear without translating them!
When you get this error, you literally get an error about the arguments. For example, it may appear when the number of arguments is incorrect or the value is incorrect.
Suppose you get the following error statement.
Describe a part
arguments(given 2, expected 0)
Translated, Arguments (given 2, expected 0) In an extreme case, the argument passed is 2. Since the receiving side has no arguments, an error occurs.
It will be like. (ArgumentError) If you get this, look for (given, expected)!
Name error. It appears when there is a mistake in the variable name or method name. The name when defined may be incorrect, or the name when calling the method may be incorrect.
Describe a part
undefined local variable or method '〇〇'
Translated, Undefined local variable or method Let's pay attention to the variable or method of 〇〇!
did you mean? (Maybe) There are many cases where they are proposing, so check here as well!
Error related to method. This happens when the method you are trying to execute has the wrong name when you call it, or when the method has the wrong name when it is defined.
Describe a part
test.rb:2in '〇〇'
This tells you where the error is, so let's check the method in this part!
Check if there is the following description in the no method error! did you mean? (Maybe)
If you get an error sentence for the time being, let's translate it. I think that there is a part that can be seen if the meaning is understood.
You may find a solution by googled the meaning that came out!
When you get an error, you have a chance to grow. I will do my best to make you think!
Recommended Posts