简体   繁体   English

如果我安装了Rails上的jRuby,我可以只使用Ruby吗?

[英]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.

相关问题 我应该使用JRuby或Ruby for Rails与Neo4j.rb? - Should I use JRuby or Ruby for Rails with Neo4j.rb? 我可以在Ruby on Rails中让url_for使用前缀选项吗? - Can I have url_for use a prefix option in Ruby on Rails? 当我希望它使用常规ruby时,New Rails应用尝试在“bundle install”上使用jruby,有错误吗? - New Rails app tries to use jruby on “bundle install” when I expect it to use regular ruby, has errors? 如何使用带有 DB2/400 数据库的 JRuby 上的 DataMapper 在 Rails 3.1 上使用 Ruby? - How do I use Ruby on Rails 3.1 with DataMapper on JRuby with a DB2/400 database? JRuby中的Ruby脚本是否可以使用我的Java类,如果我没有与它共享它们? - Can a Ruby script in JRuby use my Java classes if I haven't shared them with it? 如何在Jruby上使用Scala列表? - How can I use Scala list on Jruby? 我可以将存储过程与ruby一起使用吗? - Can I use stored procedures with ruby on rails? 我有几个 Ruby on Rails 应用程序,还有一个 Wordpress 网站。 我怎样才能同时使用两者? - I have a couple Ruby on Rails applications and I also have a Wordpress website. How can I use both together? 我必须从源代码安装Ruby才能在Windows计算机上安装Ruby 2.2.0和Rails 4.2.0吗? - Do I have to install Ruby from source to get Ruby 2.2.0 and Rails 4.2.0 installed on my windows machine? 当我已经安装了使用Rails运行的ruby 1.8.7时,安装Ruby 1.9.1是否有任何问题? - Is there any problem installing Ruby 1.9.1 when i already have installed ruby 1.8.7 running with rails?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM