support RubyOnRails production mode
|Assignee:||Andreas Schröder||% Done:|
I can't get the thing to go into "production" environment. in config/environment.rb I see the ENV['RAILS_ENV'] ||= 'production' but that does not use the production database settings. I tried starting mongrel_rails with the production environment (manually at the command line - using
mongrel_rails start -e production). Mongrel was all kinds of angry at that. I got an error on the web page (503 I think). I'll turn that all around and ask - what's the appropriate way to switch between test/dev/production environment?
#2 Updated by Andreas Schröder over 9 years ago
- Status changed from In progress to Fixed
- Resolution set to fixed
DrQueueOnRails works in production mode.
Edit config/database.yml and enter connection info for production database:
production: adapter: postgresql database: dqor_prod username: postgres password:
Clone your current database:
sh-3.2$ /opt/local/bin/psql83 Welcome to psql83 8.3.3, the [[PostgreSQL]] interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit postgres=# create database dqor_prod template dqor_dev; CREATE DATABASE
Run Mongrel in production mode:
kaazoomla:DrQueueOnRails_TestInstance kaazoo$ mongrel_rails start -e production ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with production environment... ** Rails loaded. ** Loading any Rails specific [[GemPlugins]] ** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart). ** Rails signals registered. HUP => reload (without restart). It might not work well. ** Mongrel 1.1.5 available at 0.0.0.0:3000 ** Use CTRL-C to stop.