On Thu, Nov 26, 2009 at 12:36 PM, MichaelF <[email protected]> wrote: > I have been tinkering with RoR and JRuby for about a year to create > simple internal applications. I am working on my first "real" > application that will be deployed for use on the internet and have > some questions on proper deployment using RoR (2.2.2), JRuby (1.4) and > MySQL (5.0.x). > > (I will be deploying everything to a hosted Tomcat/MySQL environment) > > I can easily enough use Warbler to create a WAR file and deploy that > to Tomcat. I also setup a MySQL server on the hosting machine as the > app is configured to use MySQL. > > The part that is causing me heartburn is getting the DB schema up to > the hosting site. As a workaround for the initial release I simply > used mysqldump to export the entire schema and base data. I then used > the mysql command interface to load the sqldump into the server. This > works well enough for now, but what is the "right" way to deploy the > database schema and migration updates over time? > > While the app is in use over the next 3 months I will be building the > "admin/reporting" interface to it so I suspect I will need to modify > the schema in some way long after the app is in use and loaded with > real data. > > I appreciate your time and assistance with this question!
You can have warbler include your db/ directory as well as your Rakefile in the war. Then, on the server, unpack the war file somewhere and run rake as follows inside the WEB-INF directory: java -jar lib/jruby-complete-X.Y.jar -S rake db:migrate RAILS_ENV=production Some folks have gone so far as to have a custom servlet context listener run db:migrate inside the app server once the app is deployed, but that always seemed a little dodgy to me... /Nick > > --Michael > > -- > > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

