I setup my rails application on my small linode VPS, phusion passenger is installed and dealing, same with mysql (I understand this cause my pal presently is running 2 production applications onto it with similar setup). The VPS is running Ubuntu 10.10 and I am using apache2 with passenger.

I SFTP'd the application towards the server, bundle up-to-date, setup my virtual host and specified RailsEnv to become production and pathways are accurate.

Then i restarted the server (as root) with apachectl -k restart attempted to rake db:migrate also it did not do anything whatsoever, and so i figured it had been since the atmosphere did not get transformed, which is what happend. Basically enter in the rails console and kind Rails.env it provides me with development.

I've no clue why, Used to do exactly what should place it to production? Anybody understand what I might have skipped? Can there be somewhere within the application where I am designed to change something to express production atmosphere? I figured that only needed to be completed in rails 2.x

Thanks ahead of time for every help.

The RailsEnv setting is just for Passenger's use. It does not modify the instructions you enter in the spend.


RAILS_ENV=production rake db:migrate


RAILS_ENV=production rails console

Or set the RAILS_ENV atmosphere variable inside your login spend to production to ensure that it's not necessary to append RAILS_ENV=production towards the instructions you problem:

export RAILS_ENV=production

(exact command can vary based on which spend you apply the above works in party)

You had been on course all that you should do in order to really run the application being produced mode is placed the RailsEnv while you did, presuming you're running the application using Passenger. However, to operate the database migrations you have to tell Rails what atmosphere to operate within.

The rails console command defaults towards the 'development' atmosphere automatically. You have to running database migrations.

To operate the migrations in your production atmosphere you have to run the command as a result:

RAILS_ENV=production rake db:migrate

And also to run the console being produced mode, you have to run the console while using command:

rails console production