In your config directory create a file called s3.yml, Inside put:
development:
bucket: development_bucket_name
access_key_id: development_amazon_key
secret_access_key: development_secret_key
create a similar file (s3.yml) for production.
production:
bucket: production_bucket_name
access_key_id: production_amazon_key
secret_access_key: production_secret_key
Do not check the file into source control. Instead place the production one on the server in the config directory for development just leave it in config locally.
In environment/development.rb and production.rb
S3_CONFIG = YAML.load_file Rails.root.join("config/s3.yml")
Wherever you are explicitly are calling bucket_name, amazon_key, secret_key instead use
S3_CONFIG[Rails.env]["bucket"], etc