What is Rails console?

Answer

The Rails console (rails console or rails c) provides an interactive Ruby REPL (Read-Eval-Print Loop) with the full Rails application environment loaded. You can query the database (User.all), create records, call model methods, test code snippets, and inspect configuration — all without writing a script file. In production, use rails c --sandbox to prevent any writes from being committed. The console is invaluable for debugging, data inspection, and one-off data fixes.