Moving to Production


I've been happily rolling along creating my Rails apps and am at the point now where I need to keep my Development Environment and create a Production Environment.

To do this, should I simply create the _production Database using mysqladmin? If so, is there a way to have the production DB mirror what I have already done in development (i.e. Migrations for tables, etc)? To have the app then use the _production DB do I then run ruby script/server and use use -e production?

Any suggestions would be great!


Are you deploying this to a server?

Yes and no. The app will stay where it is on the server however I would like to start letting other people, internal to where I am, start using it, allowing me to continue development in the dev db, etc.

Does that help?

there is a line in config/environment.rb that you can uncomment to force it into production mode:

ENV['RAILS_ENV'] ||= 'production'


What about the DB stuff? Do I essentially duplicate what I did for the DEV env? Or can I somehow create the tables based on previous migrations?

run this:

rake RAILS_ENV=production db:migrate

and it will create everything you have done in development

Amazing, everyday I see stuff like this, I'm just so impressed with this frame work!

Thanks for your help!

have you heard of capistrano? it is helpful in deploying through subversion.

might be the next thing to tackle.