在 jruby 下的 OSX Lion 上启动 Rails 3.0.9 控制台时出现分段错误
尝试让我的 Ruby/Rails 环境在 OSX Lion 上运行。
当尝试启动 irb 或 Rails 控制台时,我间歇性地收到连接被拒绝的消息。
我刚刚重新启动机器,并在尝试 Rails 控制台时得到了这个:
Chris-Kimptons-MacBook-Air-2:unicode-parallel-bug kimptoc$ rails c
[1]+ Segmentation fault: 11 ( JRUBY_OPTS='' jruby --ng-server 2>&1 > /dev/null )
Chris-Kimptons-MacBook-Air-2:unicode-parallel-bug kimptoc$ set | grep CC
CC=gcc-4.2
Any Tips/tricks/suggestions for Jruby on OSX Lion?
看来这可能与钉枪有关。 irb 挂起,如下所示。当我杀死钉枪时,它只是给出连接拒绝 - 大概是因为它期待钉枪。
$:~ kimptoc$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-383, mixed mode)
$:~ kimptoc$ rvm use jruby
Using /Users/kimptoc/.rvm/gems/jruby-1.6.3
$:~ kimptoc$ irb
^C #just hangs
$:~ kimptoc$ ps -ae | grep java
542 ttys000 0:15.20 /usr/bin/java -Dfile.encoding=UTF-8 -server -Djdk.home= -Djruby.home=/Users/kimptoc/.rvm/rubies/jruby-1.6.3 -Djruby.script=jruby -Djruby.shell=/bin/bash -Djffi.boot.library.path=/Users/kimptoc/.rvm/rubies/jruby-1.6.3/lib/native/Darwin -Xmx500m -Xss2048k -Djruby.memory.max=500m -Djruby.stack.max=2048k -Dsun.java.command=com.martiansoftware.nailgun.NGServer -Djava.class.path=/Users/kimptoc/.rvm/rubies/jruby-1.6.3/lib/jruby.jar: com/martiansoftware/nailgun/NGServer
880 ttys001 0:00.00 grep java
$:~ kimptoc$ kill -9 542
$:~ kimptoc$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-383, mixed mode)
$:~ kimptoc$ ruby -v
connect: Connection refused
$:~ kimptoc$ ruby --help
connect: Connection refused
$:~ kimptoc$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-383, mixed mode)
我尝试重新安装 jruby (使用 rvm),它通过 irb 解决了上述错误,但随后“rails c”崩溃了,如下所示:
$ rails c
$ echo $?
227
提前致谢 克里斯
Trying to get my Ruby/Rails environment working on OSX Lion.
I am intermittently getting connection refused when trying to start irb or rails console.
I just rebooted the machine and got this when trying the rails console:
Chris-Kimptons-MacBook-Air-2:unicode-parallel-bug kimptoc$ rails c
[1]+ Segmentation fault: 11 ( JRUBY_OPTS='' jruby --ng-server 2>&1 > /dev/null )
Chris-Kimptons-MacBook-Air-2:unicode-parallel-bug kimptoc$ set | grep CC
CC=gcc-4.2
Any tips/tricks/suggestions for Jruby on OSX Lion?
It seems like it might be nailgun related. irb hangs, as per below. When I killed nailgun, it then just gives connection refused - presumably because its expecting nailgun.
$:~ kimptoc$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-383, mixed mode)
$:~ kimptoc$ rvm use jruby
Using /Users/kimptoc/.rvm/gems/jruby-1.6.3
$:~ kimptoc$ irb
^C #just hangs
$:~ kimptoc$ ps -ae | grep java
542 ttys000 0:15.20 /usr/bin/java -Dfile.encoding=UTF-8 -server -Djdk.home= -Djruby.home=/Users/kimptoc/.rvm/rubies/jruby-1.6.3 -Djruby.script=jruby -Djruby.shell=/bin/bash -Djffi.boot.library.path=/Users/kimptoc/.rvm/rubies/jruby-1.6.3/lib/native/Darwin -Xmx500m -Xss2048k -Djruby.memory.max=500m -Djruby.stack.max=2048k -Dsun.java.command=com.martiansoftware.nailgun.NGServer -Djava.class.path=/Users/kimptoc/.rvm/rubies/jruby-1.6.3/lib/jruby.jar: com/martiansoftware/nailgun/NGServer
880 ttys001 0:00.00 grep java
$:~ kimptoc$ kill -9 542
$:~ kimptoc$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-383, mixed mode)
$:~ kimptoc$ ruby -v
connect: Connection refused
$:~ kimptoc$ ruby --help
connect: Connection refused
$:~ kimptoc$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-383-11A511)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-383, mixed mode)
I tried re-install jruby (using rvm) and it got past the above error with irb, but then "rails c" crashes, like so:
$ rails c
$ echo $?
227
Thanks in advance
Chris
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过重新安装 jruby 解决了这个问题(也可能是 rvm - 抱歉,现在不记得了)。
可能部分与射钉枪问题有关——现在应该得到解决。
Solved it by re-installing jruby (possibly rvm too - sorry, cant remember now).
Probably partly related to nailgun issues- which should now be resolved.