Forum: Ruby on Rails staging deploy connected to production database

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1d4a45a695b48edc70359ca6d015e2f4?d=identicon&s=25 John Merlino (johnmerlino)
on 2013-05-15 17:57
(Received via mailing list)
I'm not sure why but I have both a staging and production deploy using
the 'capistrano/ext/multistage' gem. I set staging to the default:

set :stages, ["staging", "production"]
set :default_stage, "staging"

It deploys correctly to the right path:
#deploy/staging.rb
set :deploy_to, "/home/myuser/public_html/mysite/"

But it connects to the production database not staging database in my
database.yml file:

staging:
  adapter: mysql2
  encoding: utf8
  database: staging_database
  pool: 5
  username: username
  password: password
  socket: /var/run/mysqld/mysqld.sock
  host: host

production:
  adapter: mysql2
  encoding: utf8
  database: production_database
  pool: 5
  username: username
  password: password
  socket: /var/run/mysqld/mysqld.sock
  host: host

Why is it linking to the production database and not staging? I don't
see where that option is specified during the deploy process.
Ce5e201eca55d4f79d0ead9acc91d544?d=identicon&s=25 Dheeraj Kumar (Guest)
on 2013-05-15 18:46
(Received via mailing list)
set :rails_env, 'staging'
set :rails_env, 'production'


^^ add these in the appropriate files.

--
Dheeraj Kumar
This topic is locked and can not be replied to.