是否可以将Rails应用程序编译为Java VM JAR文件? [英] Is it possible to compile a Rails app to a Java VM JAR file?
问题描述
基本上我可以部署到我的部署机器的唯一事情是JAR文件。我无法安装JRuby,也无法安装Glassfish或Tomcat。
Essentially the only thing I can deploy to my deployment machine is a JAR file. I can't install JRuby, nor can I install Glassfish or Tomcat.
是否可以打包一个Rails应用程序(包括Rails,当然是出售的)我可以做的JAR文件
Is it possible to package up a Rails application (including Rails, vendored, of course) to a JAR file such that I can do
c:\my_server> java rails_app.jar
并让它在JVM中运行WEBRick或Mongrel?
and have it run WEBRick or Mongrel within the JVM?
推荐答案
我建议您结帐Jetty。 嵌入Jetty 的过程非常简单,应该可以给它来自当前jar文件的servlet。我没有使用Ruby / Rails,所以我不确定那里是否有任何复杂问题。
I'd recommend that you checkout Jetty. The process for Embedding Jetty is surprisingly easy, and it should be possible to give it your servlets from your current jar file. I haven't used Ruby/Rails, though, so I'm not sure if there are any complications there.
通常是否可以嵌入所有的rails模板/ model进入war文件中的jar,以便在Tomcat上部署?如果是这样,那么你应该能够将嵌入式Jetty从你的单个jar中拉出来。
Is it normally possible to embed all of your rails templates/models into a jar inside of a war file for deployment on Tomcat? If so, then you should be able to get embedded Jetty to pull it from your single jar as well.
这篇关于是否可以将Rails应用程序编译为Java VM JAR文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!