How can I set the RAILS_ENV in a Windows console?
ruby, ruby-on-rails, windows, windows-xp
Solution
c:>set RAILS_ENV=monster_island
If you run set without any other arguments, you will see the environment variables that are set. Running set in a console will set that variable for just that console and won't be persisted across sessions or to other consoles.
You can also set it permanently in the Control Panel - open System, select Advanced, and then Environment Variables (this may vary slightly depending on your version of Windows).
Problem
On Linux and OS X, I'm accustomed to running Rake tasks in specified Rails "environments" by doing this: ``` $ export RAILS_ENV=monster_island ; rake monsters:destroy_all ``` How can I do the equivalent if I'm running the task on Windows XP in a Windows console?