I just noticed that a rake drop all command can also drop tables in the production db instance. Is there a way in rails to separate rails config so that the production systems are not touched by any commands from development environments ?
Separate and isolate production connections away from your development setup.
Your local database.yml should not have production credentials and connections in it, and should instead use environment variables that are only supplied in production environments.