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.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Dheeraj Kumar at May 15, 2013 at 4:50 pm
    set :rails_env, 'staging'
    set :rails_env, 'production'


    ^^ add these in the appropriate files.

    --
    Dheeraj Kumar

    On Wednesday 15 May 2013 at 9:25 PM, John Merlino wrote:

    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.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com (mailto:rubyonrails-talk+unsubscribe@googlegroups.com).
    To post to this group, send email to rubyonrails-talk@googlegroups.com (mailto:rubyonrails-talk@googlegroups.com).
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMay 15, '13 at 3:55p
activeMay 15, '13 at 4:50p
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Dheeraj Kumar: 1 post John Merlino: 1 post

People

Translate

site design / logo © 2022 Grokbase