# Ruby: ArgumentError: missing keyword: :name / unknown keyword: :nmae

**Code:** `ArgumentError: missing keyword / unknown keyword` · **Category:** Ruby / Rails · **Seen on:** Ruby

A method requiring keyword arguments was called without them, or with a misspelt keyword.

## Meaning

Pass the required keywords (`foo(name: "x")`), fix typos, and in Ruby 3 convert hashes with `**hash`. The message names the keyword. For Rails callbacks/factories check the signature after upgrades (e.g. `before_action only:`).

## Common causes

- Required keyword missing
- Typo in keyword name
- Ruby 3: hash passed as last positional argument
- Method renamed/changed in a gem upgrade
- Block keyword params

## Quick fix

1. Pass `foo(name: value)`
2. Use `foo(**options)` for hashes
3. Check the gem changelog for signature changes

## Detailed fix by platform

### Ruby

1. `def foo(name:, age: 18); end; foo(name: "A")`

## How to diagnose

1. **Keyword** — Named?
2. **Typo** — Spelling?
3. **Hash** — ** used?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/ruby/argumenterror-missing-keyword)
