In the command line syntax for sass/compass it is possible to pass the environment variable.
compass compile -e=production
A small change to the config.rb will allow the system to set this flag based upon the switch.
# Default to development if environment is not set. saved = environment if (environment.nil?) environment = :development else environment = saved end
Above will allow you to use the switch to change the environment variable.