将项目从 Ruby on Rails 更改为 JRuby on Rails

发布于 2025-01-05 10:14:35 字数 163 浏览 2 评论 0原文

我需要修改什么才能将普通的 Ruby on Rails 项目更改为 JRuby on Rails 项目?另外,我在 RoR 项目中包含的 gem 是否有可能在我的项目的 JRuby 版本中被破坏?

最后,有没有办法在 APTANA 或任何其他编辑器中创建 JRuby on Rails 应用程序?

What do I need to modify to change my ordinary Ruby on Rails project into a JRuby on Rails project? In addition, is it likely that a gem I included in my RoR project will be broken in the JRuby version of my project?

Lastly is there any way to create a JRuby on Rails app in APTANA or any other editor?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

月棠 2025-01-12 10:14:35

您需要切换到 Jruby 而不是 Ruby,这可以使用 RVM 来完成。 (www.beginrescueend.com)

当您切换到 jruby 时,您会遇到 gem 兼容性问题,并非所有 gem 都可以工作。通常带有 C 扩展名的 gem。

最后,对于 IDE,我确信 aptana 没问题。您仍在编写 ruby​​ 代码。当您运行代码时,您将使用 JVM。

You will need to switch to Jruby instead of Ruby and this could be done using RVM. (www.beginrescueend.com)

You will have problems with gem compatibility when you switch to jruby not all gems will work. Usually gems with C extensions.

Lastly, for an IDE I am sure aptana is fine. You are still writing ruby code. Just when you run your code you will be using the JVM.

天冷不及心凉 2025-01-12 10:14:35

jruby 相对于普通 ruby​​ 的主要优点是我们可以调用 java 库。如果您愿意,您甚至可以使用 Hibernate。

如果您使用的是 Windows 计算机,则需要使用 PIK(RVM for Windows)进行切换。

就像 ericraio 所说,可能存在一些 gem 依赖性,但大多数时候捆绑器会处理这个问题,所以你不需要担心事情(大多数时候)。
如果您想检查特定的 gem,请访问此网站 http://rubygems.org/

对于我的开发,我使用 NetBeans 6.9.1。如果您需要有关如何在 netbeans 中编写第一个程序的任何帮助,我随时准备提供帮助。

我更喜欢使用命令提示符来创建和运行 Rails 项目

The main advantage of jruby instead of normal ruby is we can call the java libraries. And if you want you can even use Hibernate.

And switching if you are on a windows machine you need to use PIK(RVM for windows).

Like ericraio said there may be some gem dependency but most of the time the bundler will take care of that, so you don't need to worry about things(Most of the time).
If you want to check a particular gem please visit this site http://rubygems.org/

For my development I'm using NetBeans 6.9.1. If you want any help regarding how to make you first program in netbeans I'm ready to help.

I prefer to use command prompt to create and run rails project

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文