change the rails environment detecte method.