[英]If I have jRuby on Rails installed can I use only Ruby?
What I mean by this is if I install jRuby on Rails, can I use only the ruby language to build my application? 我的意思是,如果我在Rails上安装jRuby,我是否可以只使用ruby语言来构建我的应用程序? I wanted to install my rails application with jRuby in case I wanted to use Java in the future, though I don't need it now. 我想用jRuby安装我的rails应用程序,以防我以后想要使用Java,尽管我现在不需要它。 Or do I not understand? 或者我不明白? Is jRuby ruby that has access to java libraries? jRuby ruby是否可以访问java库?
yes, jruby is ruby (your ruby scripts need no modification to run under jruby). 是的,jruby是ruby(你的ruby脚本不需要修改就可以在jruby下运行)。 in addition, it has full access to java libraries - check out the wiki for how easy it is to integrate a java class or library into your ruby code. 此外,它可以完全访问java库 - 查看wiki ,将java类或库集成到ruby代码中是多么容易。
The others have answered your direct question. 其他人已经回答了你的直接问题。 I just want to say that I've been using jruby full time at work for the past 6 months and it's great. 我只想说,过去6个月我一直在使用jruby全职工作,这很棒。 Deploying a rails app with the glassfish gem is very easy and jruby performs better than MRI ruby 1.8.x. 使用glassfish gem部署rails应用程序非常容易,jruby比MRI ruby 1.8.x更好。
I've seen no real downside after 6 months other than the fact that we can't use gems that have pieces written in C. However, we've taken a C library and created a gem using FFI and it wasn't too much trouble. 我看到6个月之后没有真正的缺点,除了我们不能使用有C编写的碎片的事实。但是,我们采用了C库并使用FFI创建了一个宝石并且它没有太多麻烦。
It's also really easy to speed up your app by writing a few key pieces in java (which is easier t work with than C). 通过在Java中编写一些关键部分来加速应用程序也非常容易(这比使用C更容易)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.