Environment management problem

Hi, i have a rails app with the three default environments. Everything
works fine until I added a new environment. I added it by copying out
the
production env file. The problems which this led to:
i) I was using jqueryui autocomplete which failed to load when i tried
(rails s -e staging). So i went ahead to precompiled assets using rake.
Then the assets(images) also stopped loading (Error : no route matches
).I tried running the server in default(dev) mode and
lo
and behold the images were loading but nw the jqui autocomplete also
started bugging here.
ii) I mentioned fb app settings in facebook.yml for staging(my new env),
but it still points to the app constants set for the development mode.

ANY HELP would be highly appreciated. I’m stuck with this for 2-3 days
now.