在 jruby 下的 OSX Lion 上启动 Rails 3.0.9 控制台时出现分段错误

发布于 2024-11-26 14:57:32 字数 2022 浏览 1 评论 0原文

尝试让我的 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 技术交流群。

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

发布评论

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

评论(1

森林很绿却致人迷途 2024-12-03 14:57:32

通过重新安装 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.

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