jruby and jgem both throwing 'Trace/BPT trap' on Mac OS X 10.6
I recently installed jgem and jruby on Mac OS X 10.6.4 with macports. Now both of them generate the notorious 'Trace/BPT trap' error when I try to run them.
For example, from the command line:
$ jgem --version Trace/BPT trap $ jruby --version jruby 1.5.2 (ruby 1.8.7 patchlevel 249) (2010-11-03 6586) (Java HotSpot(TM) Client VM 1.6.0_03-p3) [i386-java] Trace/BPT trap
This is not the first version of either of these programs I have installed on this machine, so I am curious if perhaps some old version of either java or ruby is to blame. I'm not familiar enough with jgem or jruby internals to know if that is even a rea开发者_StackOverflow社区sonable guess.
Here are my ruby and java versions:
$ java -version
java version "1.6.0_03-p3"
$ ruby --version
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin10]
Any insight is much appreciated. Thanks in advance.
Just figured out my problem!
The version of java was to blame. It was out-of-date and also for Mac OS X 10.5, from which I have recently upgraded. To solve this problem, here's what I did:
- Download and install the most recent version of the jdk for Mac OS X 10.6 here.
- The newly installed java bin folder is at
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin
. Add this to the front of your$PATH
in your profile file. - Restart terminal or source the profile file.
- Type
which java
in terminal. The output should be the java installation path above with a/java
at the very end. - Type
jruby --version
. If jruby is now working, it should output something pleasant likejruby 1.5.2 (ruby 1.8.7 patchlevel 249) (2010-11-09 6586) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_22) [x86_64-java]
- Now you're done. Hurray for simple problems!
精彩评论