开发者

Segmentation fault when starting rails 3.0.9 console on OSX Lion under jruby

开发者 https://www.devze.com 2023-03-23 06:51 出处:网络
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.

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/k开发者_如何学编程imptoc/.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


Solved it by re-installing jruby (possibly rvm too - sorry, cant remember now).

Probably partly related to nailgun issues- which should now be resolved.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号