Note that there are some explanatory texts on larger screens.

plurals
  1. POProduction environment is using staging database rather than production database
    text
    copied!<p>I have 4 Rails environments.</p> <ul> <li>test</li> <li>development</li> <li>staging</li> <li>production</li> </ul> <p>Rails are deployed perfectly to staging and production except the fact that production Rails is using staging database instead of production database. What am I doing wrong? What haven't I checked yet? Is there something in Capistrano where database setup is needed?</p> <p>Here are some things to note.</p> <p><strong>My <code>config/database.yml</code> clearly differentiates staging and production databases.</strong></p> <pre><code>staging: adapter: mysql2 encoding: utf8 database: some_app pool: 5 username: some_user password: some_pass host: staging.zzzzz.com port: 1911 production: adapter: mysql2 encoding: utf8 database: some_app pool: 5 username: some_user password: some_pass host: production.zzzzz.com port: 1611 </code></pre> <p><strong>Rails environment for production and staging are identical.</strong> In other words, <code>config/environments/staging.rb</code> and <code>config/environments/staging.rb</code> are identical.</p> <p><strong>Passenger server in production environment should be running the Rails app in production environment.</strong> See the line <code>RailsEnv production</code></p> <pre><code>&lt;VirtualHost *:80&gt; LoadModule passenger_module /opt/ruby-enterprise-1.8.7-2011.12/lib/ruby/gems/1.8/gems/passenger-3.0.11/ext/apache2/mod_passenger.so PassengerRoot /opt/ruby-enterprise-1.8.7-2011.12/lib/ruby/gems/1.8/gems/passenger-3.0.11 PassengerRuby /opt/ruby-enterprise-1.8.7-2011.12/bin/ruby PassengerMaxPoolSize 20 Include conf/rhapcom.conf Include conf/maintenance.conf Include conf/redirects.conf DocumentRoot /var/rails80/current/public &lt;Directory /var/rails80/current/public&gt; RailsEnv production AllowOverride all Options -MultiViews &lt;/Directory&gt; &lt;/VirtualHost&gt; Include conf/oldrotw.conf </code></pre> <hr> <p>After some investigation, I found that production app is actually running in integration environment. I checked this through <code>Rails.env</code>. How do I specify to the production app that it should be running in <code>production</code> environment?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload