My rails project is deployed to tomcat with the help of warbler, but I need to be able to run rake tasks on that server.
Asked
Active
Viewed 895 times
1 Answers
3
Stay tuned. I hope to have this capability in Warbler 1.4. Jake Goulding, a community member, has been doing some great work on this.
Until then, a typical approach would be to ensure all your Rake and database scripts are present in the war file, then just unpack it somewhere, cd to WEB-INF
inside the unpacked war, and run something like java -cp lib/jruby-core*.jar:lib/jruby-stdlib*.jar org.jruby.Main -S rake -T
.

Nick Sieger
- 3,315
- 20
- 14
-
java -cp lib/jruby-core*.jar:lib/jruby-stdlib*.jar org.jruby.Main -S rake -T --trace gets me an error that leads to the line where I include Warbler::Task.new in one of my rake files. Warbler is included in the gems.jar. – Karnage Jun 04 '11 at 04:26
-
I think I've almost got it. I put the 'Warbler::Task::new' and related code in a separate file and excluded it from the war file. – Karnage Jun 06 '11 at 16:14
-
I was able to make this a lot easier by putting Nick's logic into a script in the bin directory and deploying that directory with the project. I named the script "tomcat-rake". – Karnage Jul 13 '11 at 12:51