将JRuby on Rails应用程序部署到Tomcat的最佳方法是什么?

将JRuby on Rails应用程序部署到Tomcat的最佳方法是什么?

问题描述:

我正在寻找将Ruby on Rails应用程序(在JRuby上运行)部署到Tomcat实例进行测试的方法。

I'm looking at ways to deploy a Ruby on Rails app (running on JRuby) to a Tomcat instance for testing.

tomcat实例在一个我可以SSH到的Solaris服务器。我已经研究过使用Capistrano,但似乎没有太多关于使用它来部署到Tomcat或什至在JRuby下运行的方法,由于Windows / JRuby环境,我一直在Capistrano中遇到错误我的PC正在运行(是的,这是公司的-不是我的选择,但我必须忍受它。)。

The tomcat instance is running on a Solaris server that I can SSH to. I've looked at using Capistrano, but there doesn't seem to be a lot out there about using it to deploy to Tomcat, or even about running it under JRuby, and I keep hitting bugs in Capistrano due to the Windows/JRuby environment my PC is running (yeah, it's corporate - not my choice, but I've got to live with it).

我正在使用Warble来构建.war文件,并且一旦我手动将其复制并部署,该应用就会部署并运行良好。我想要更轻松,更自动化的方法来真正实现目标。

I'm using warble to build the .war file, and the app deploys and runs fine once I manually copy it up and deploy it. I'm wanting something easier and more automated to actually get it there.

有人做过吗?网络上的文档似乎很薄。

Anyone done this before? Documentation on the web seems pretty thin.

我对此没有太多经验,所以不知道是否我可以给您最好的方法,但是如果Capistrano无法正常工作,并且您无法单独安装MRI来运行它,那么您只剩下几种选择:

I don't have much experience on this, so I don't know if I can give you the BEST way, but if Capistrano doesn't work, and you can't have a separate MRI install just to run it, you have just a few alternatives left:

尝试运行普通Rake并编写自己的部署目标:
http://www.gra2.com/article.php/deploy-ruby-on-rails-applications-rake

Try running plain Rake and write your own deployment target: http://www.gra2.com/article.php/deploy-ruby-on-rails-applications-rake

或者使用Ant或Maven。

Or use Ant or Maven.

或者如果您仅要将它部署到一个服务器,则可以将两个Ruby脚本合在一起-一个监听服务器上的脚本关闭/启动请求,以及您要运行的一个本地:发送关闭,对文件进行scp,发送启动。

Or if it just ONE server you have to deploy to, you could just hack together two Ruby scripts - one that listens on the server for shutdown/startup requests, and one local that you run to: Send shutdown, scp over the file, send startup.

顺便说一句,您是否提交了任何集成错误在Capistrano中找到JRuby团队吗?我相信他们会很乐意为您做任何贡献。
:)

By the way, have you submitted any integration bugs you find with Capistrano to the JRuby team? I'm sure they'd be happy to have any contribution. :)