Ruby Error Messages
Dynamic language and its reference interpreter.All Ruby pages
- Ruby ArgumentError: wrong number of arguments (given 1, expected 0)Ruby raises ArgumentError when a call passes more or fewer arguments than the method accepts, or a hash where Ruby 3 keywords are expected. Match the signature.
- Ruby NoMethodError: undefined method for nilRuby raises NoMethodError undefined method for nil when a method is called on a value that is nil, often a failed lookup. Find the nil source; use &. or fetch.
- Ruby: cannot load such file -- name (LoadError)Ruby raises LoadError when require finds no file: the gem is not installed for this Ruby or not in the Gemfile, or a local file needs require_relative instead.
- Ruby: uninitialized constant Name (NameError)Ruby raises NameError uninitialized constant when a class or module is used before it is loaded or is misspelled. In Rails, the file name must match the class.