How do I run rake rake tasks in a rails app which is served by tomcat with jruby war deployment?

泄露秘密 提交于 2020-01-03 02:51:14

问题


I have a rails application deployed to tomcat, the code has been compiled to java classes and packed to a war file. And I'm wondering, is there a way for me to run rake tasks as I always did ?


回答1:


I'd like a convenient way of doing this too, although I'm not sure it's possible.

From the exploded (unzipped) WAR, you can get somewhere with this kind of thing:

  java -cp WEB-INF/lib/jruby-core-1.6.4.jar -S rake



回答2:


java -jar WEB-INF/lib/jruby-core-1.6.4.jar -S rake

This worked for me. Possibly the same as the previous answer, but I do not know enough about java, .war files, or jruby, to say in any certainty.



来源:https://stackoverflow.com/questions/4296033/how-do-i-run-rake-rake-tasks-in-a-rails-app-which-is-served-by-tomcat-with-jruby

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!