JRuby 的可靠性如何?
我有兴趣在我们的办公室推广 JRuby 作为托管 Rails 应用程序的平台。
但它的可靠性如何?
它的性能比MRI 1.8.7更好吗?
JRuby 1.5 声明它与 Ruby 1.8.7 100% 兼容,这是否意味着 JRuby 可以运行任何 Ruby/Rails 代码?
I'm interested in promoting JRuby in our office as the platform hosting Rails applications.
But how reliable is it?
Is its performance better than MRI 1.8.7?
JRuby 1.5 states that it is 100% compatible with Ruby 1.8.7, does this mean that JRuby can run any Ruby/Rails code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
是的,JRuby 很可靠! Oracle 使用 JRuby 进行 Oracle mix (http://mix.oracle.com/),Sun 也使用过它对于 Kenai (http://kenai.com),它将成为 java.net 的下一个基础(来自 kenai站点:“将 Java.net 域迁移到 Kenai 基础设施的工作正在进行中”)!
您可以运行几乎所有代码,一些 gems 使用本机 C 扩展,并且在 JRuby 中对其有原始支持,但是是的......rails 可以正常工作。
您可以使用 Warbler 将 Rails 应用程序部署在 Tomcat 或 JBoss 等应用程序服务器中,Warbler 将 Rails 应用程序包装在 .war 文件中,这非常棒!
更新:您可以在这里看到很多基准: http://programmingzen.com/2010/07/19/the-great-ruby-shootout-july-2010/
Yes, JRuby is reliable! Oracle uses JRuby for Oracle mix (http://mix.oracle.com/), Sun had used it for Kenai (http://kenai.com), and it's gonna be the next base for java.net (from kenai site: "Work is on-going for migrating the Java.net domain over to the Kenai infrastructure")!!
You can run almost every code, some gems uses native C extension and in JRuby there's a primitive support to it, but yes...rails just works.
You can deploy Rails apps in Application Servers like Tomcat or JBoss with Warbler that wraps Rails apps inside a .war file, it's pretty awesome!
update: you can see a lot of benchmarks here: http://programmingzen.com/2010/07/19/the-great-ruby-shootout-july-2010/
我现在正在做很多 jruby 工作,可以告诉你,rails 在 jruby 解释器下肯定是一个可行的选择。我非常高兴,就我而言,必须使用许多本机 Java 库,因此 jRuby 是 Java 代码的一个很棒的包装器。我想说的是,我遇到了一些技术挑战,有些已经解决,有些还没有解决。
如果您有兴趣,我强烈推荐 Pragmantic Programmers 的 jruby 书(测试版),网址为 http://pragprog.com
I am doing a lot of jruby work right now and can tell you that rails is certainly a viable option under the jruby interpreter. I've been pretty pleased and in my case have to use many native Java libraries, so jRuby is just such an awesome wrapper around that java code. I will say that I have had some technical challenges some that are worked out, some that are not yet.
if you are interested I would highly reccomend the jruby book, in beta, from Pragmantic Programmers at http://pragprog.com
JRuby 摇滚!!原因很简单,就是它的可移植性以及与 Java 库的集成。我个人将它与 Netbeans 一起使用,并且附带的快速调试器似乎非常方便。另外,您不希望看到本机构建错误并处理它们。您为 JRuby 下载的所有这些 gem 在任何平台上都可以 100% 工作。使用 JRuby,您只需引入 Java 平台独立性的优势。
此外,JRuby 使用本机线程,它使用操作系统线程而不是 CRuby 中的绿色线程(我认为最新版本的情况并非如此)。
在 Gist 中,请使用 JRuby!
JRuby rocks!! The simple reason being its portability features and integration with Java libraries. I personally use it with Netbeans and the fast debugger that comes with that seems very handly. Plus you do not want to see that native build errors and handling them. All these gems that you download for JRuby work 100% across any platform. With JRuby, you are simply bringing in the advantages of the Java's Platform independence.
Moreover, JRuby uses native threading which uses OS threads instead of Green threads as in CRuby (i think its not the case with the latest versions though)
In Gist, go JRuby!!
对于 Windows,我发现在处理大量数据时它比 MRI 稳定得多。 Windows 上仍然存在一些错误,但实际上可以解决。推荐。
for windows I have found it to be much more stable than MRI when working with larger amounts of data. There are some bugs on windows still but they are actually work-around-able. Recommend.
免责声明:我在日常工作中不使用 jruby - 我只是尝试使用 jruby 运行现有代码。
这并不意味着它将成功运行所有代码。例如,bioruby 目前在 jruby 上调用 fork,尽管 jruby 并不真正支持它。 (虽然这更像是 bioruby 中的错误,而不是 jruby 中的错误)
但我不会称这种行为“不可靠”。它是自动防故障的,就像一架不会离开地面的飞机,更少的崩溃。
Disclaimer: I don't use jruby in my day job - I merely experimented with running existing code using jruby.
It doesn't mean that it'll run all code successfully. For example, bioruby currently calls fork on jruby even though jruby doesn't really support it. (That's more of a bug in bioruby than a bug in jruby though)
I wouldn't call such behaviour "unreliable" though. It's fail-safe, like a plane that would not get off the ground, much less crash.