将Ruby on Rails项目转换为JRuby on Rails项目

时间:2022-07-09 20:42:23

is there any particular way to convert a Ruby on Rails project to a JRuby on Rails project? There now is a need to get the Rails side to talk to a Java server via RMI so was wondering how to make the conversion. Thanks.

有什么特别的方法可以将Ruby on Rails项目转换为JRuby on Rails项目吗?现在需要让Rails端通过RMI与Jav​​a服务器通信,因此想知道如何进行转换。谢谢。

2 个解决方案

#1


7  

As @Karl says, it pretty much works but there are a number of caveats you should be aware of:

正如@Karl所说,它几乎可行,但你应该注意一些警告:

  • The database adapters will be different from the ones you may be used to. They're based on JDBC. For example, the MySQL adapter install is described here
  • 数据库适配器将与您可能习惯的不同。它们基于JDBC。例如,此处描述了MySQL适配器安装

  • You will generally deploy to Java application servers in production such as Glassfish, Tomcat or Jetty. Typically this is done using Warbler
  • 您通常会部署到生产中的Java应用程序服务器,例如Glassfish,Tomcat或Jetty。通常这是使用Warbler完成的

  • Certain gems with native extensions may not work. See here for details on the what is required
  • 某些具有原生扩展名的宝石可能无效。有关所需内容的详细信息,请参见此处

#2


2  

It pretty much just works, you simply run it with JRuby instead of Ruby.

它几乎可以工作,你只需用JRuby而不是Ruby运行它。

You might be interested in this though: http://jrubyist.wordpress.com/2009/07/15/jruby-and-sqlite3-living-together/

您可能对此感兴趣:http://jrubyist.wordpress.com/2009/07/15/jruby-and-sqlite3-living-together/

#1


7  

As @Karl says, it pretty much works but there are a number of caveats you should be aware of:

正如@Karl所说,它几乎可行,但你应该注意一些警告:

  • The database adapters will be different from the ones you may be used to. They're based on JDBC. For example, the MySQL adapter install is described here
  • 数据库适配器将与您可能习惯的不同。它们基于JDBC。例如,此处描述了MySQL适配器安装

  • You will generally deploy to Java application servers in production such as Glassfish, Tomcat or Jetty. Typically this is done using Warbler
  • 您通常会部署到生产中的Java应用程序服务器,例如Glassfish,Tomcat或Jetty。通常这是使用Warbler完成的

  • Certain gems with native extensions may not work. See here for details on the what is required
  • 某些具有原生扩展名的宝石可能无效。有关所需内容的详细信息,请参见此处

#2


2  

It pretty much just works, you simply run it with JRuby instead of Ruby.

它几乎可以工作,你只需用JRuby而不是Ruby运行它。

You might be interested in this though: http://jrubyist.wordpress.com/2009/07/15/jruby-and-sqlite3-living-together/

您可能对此感兴趣:http://jrubyist.wordpress.com/2009/07/15/jruby-and-sqlite3-living-together/