本文介绍了在Rails 3.2中使用JRuby的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人使用RVM在Mac OSX Lion上安装Rails 3.2和JRuby 1.6.5取得了成功吗?我打算在我的生产服务器上将TorqueBox与NGINX一起使用,并且试图将尽可能多的开发技术模仿到我的开发机器上.我还没有在生产服务器上安装TorqueBox,到目前为止,在安装OSX RVM时,我从现有的Rails 3.2应用程序中遇到了一些错误,该应用程序可以在1.9.2和REE上正常使用.

Has anyone had any success with installing Rails 3.2 and JRuby 1.6.5 on Mac OSX Lion using RVM? I'm planning on using TorqueBox with NGINX on my production server and I'm trying to mimic as much of the development technology onto my development machine as possible. I haven't gotten to install TorqueBox on my production server, and so far with my OSX RVM install I'm getting a few errors from an existing Rails 3.2 app that works fine with 1.9.2 and REE.

我遇到的问题是:

GEM 是与JRuby(1.6.5)一起安装时失败的少数Gems.

Where GEM is any of the handful of Gems that fail when installed with JRuby (1.6.5).

基本上我要问的是,如果我不想在开发机器上使用JRuby,而只坚持1.9.2,然后仅在生产机器上使用JRuby,那么这真的是一个问题吗?还是我应该继续尝试使其在Lion上运行?

Basically what I'm asking is that if I were to not use JRuby on my dev machine and stick to just 1.9.2 and then use JRuby only on the production machine then is this really a problem? Or should I continue trying to get it to work on Lion?

-编辑--

到目前为止,此功能适用于1.6.6,但在启动后首次访问Rails 3.2时似乎会挂起.控制台中没有错误.有什么想法吗?

So far this works with 1.6.6, but Rails 3.2 seems to hang when first accessed after it is booted up. No errors in the console. Any ideas?

推荐答案

您使用-rpath描述的问题是 http://bugs.jruby.org/6199 .这在JRuby 1.6.6中已解决.

The problem you are describing with -rpath is http://bugs.jruby.org/6199. This is fixed in JRuby 1.6.6.

C扩展名与JRuby一起用于生产环境.它们大部分工作(有些仍然失败),但是速度可能很慢.请咨询 https://github.com/jruby/jruby/wiki/C-Extension -替代方法,并使用jruby-lint来查看是否可以摆脱尽可能多的C扩展.

C extensions are not particularly recommended for use with JRuby in production. They work for the most part (some still fail), but they can be quite slow. Please consult https://github.com/jruby/jruby/wiki/C-Extension-Alternatives and use jruby-lint to see if you can get rid as much of your C extensions as possible.

我个人的建议是使您的开发机器尽可能接近生产机器,但不要遗漏细节.您需要在开发机器上提高工作效率,但是当生产Ruby运行时与开发机器上的运行时完全不同时,您就不会想要错误的无敌感.

My personal recommendation is to get your development machine as close to the production machine as reasonably possible, but don't sweat the details. You need to be productive on your development machine, but you don't want a false sense of invincibility when the production Ruby runtime is completely different from the one on your development machine.

这篇关于在Rails 3.2中使用JRuby的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 06:44