Rails console options to make your life better
Often when learning or testing out an implementation in planning, entering into a REPL to get some feedback and play with something more physical is desirable.
Here are some tips to improve your rails console workflow:
Specify the environment you wish to use
Maybe you want to try and reproduce an error in production during your test runs. Maybe you want to seed the database for your development server before having created a seed file. Maybe you’re just feeling wild for the day and want to switch things up.
Rails gives you the option to select the environment for the console session:
>rails c --environment=test [test/development/production/...other...] >rails c test # as a shorthand
Note: The default environment is set to development