安装原子JDK8时出错?

时间:2013-11-09 06:35:17

标签: ruby-on-rails ruby gem

我看了Error Installing Atomic

但我的问题不同:

/Users/pills/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb 
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/pills/.rvm/rubies/ruby-1.9.3-p448/bin/ruby
    --with-atomic_reference-dir
    --without-atomic_reference-dir
    --with-atomic_reference-include
    --without-atomic_reference-include=${atomic_reference-dir}/include
    --with-atomic_reference-lib
    --without-atomic_reference-lib=${atomic_reference-dir}/lib
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'
    from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:712:in `try_run'
    from extconf.rb:26:in `<main>'

从原子网页我读到原子需要JDK8,我安装了它,我在OS X 10.9。

其他一些有用的信息:

$ /usr/libexec/java_home                                                
/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home
$ /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin/java -version
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b114)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b56, mixed mode)

安装此gem时我应该如何引用JDK8?问题是什么?

更有用的输出?

cat /Users/pills/.rvm/gems/ruby-1.9.3-p448/gems/atomic-1.1.14/ext/mkmf.log 
"/usr/local/bin/gcc-4.2 -o conftest -I/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/x86_64-darwin12.4.0 -I/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/backward -I/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include  -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration  -fno-common -pipe conftest.c  -L. -L/Users/pills/.rvm/rubies/ruby-1.9.3-p448/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L.  -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib      -lruby.1.9.1  -lpthread -ldl -lobjc "
In file included from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
                 from conftest.c:1:
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:48:21: error: string.h: No such file or directory
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:58:21: error: stdint.h: No such file or directory
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:61:23: error: inttypes.h: No such file or directory
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:65:19: error: stdio.h: No such file or directory
In file included from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:67,
                 from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
                 from conftest.c:1:
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/defines.h:29:21: error: stdlib.h: No such file or directory
In file included from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
                 from conftest.c:1:
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:74:20: error: alloca.h: No such file or directory
In file included from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:178,
                 from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
                 from conftest.c:1:
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h:10:25: error: limits.h: No such file or directory
In file included from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:1383,
                 from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
                 from conftest.c:1:
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:36:23: error: sys/types.h: No such file or directory
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:40:22: error: sys/time.h: No such file or directory
In file included from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:43,
                 from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:1383,
                 from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
                 from conftest.c:1:
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/st.h:130: error: expected declaration specifiers or '...' before 'uint32_t'
In file included from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/ruby.h:1383,
                 from /Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby.h:32,
                 from conftest.c:1:
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:294: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rb_fdset_t'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:389: error: expected declaration specifiers or '...' before 'fd_set'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:389: error: expected declaration specifiers or '...' before 'fd_set'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:389: error: expected declaration specifiers or '...' before 'fd_set'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:389: warning: 'struct timeval' declared inside parameter list
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:389: warning: its scope is only this definition or declaration, which is probably not what you want
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:390: error: expected declaration specifiers or '...' before 'rb_fdset_t'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:390: error: expected declaration specifiers or '...' before 'rb_fdset_t'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:390: error: expected declaration specifiers or '...' before 'rb_fdset_t'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:390: warning: 'struct timeval' declared inside parameter list
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:391: warning: 'struct timeval' declared inside parameter list
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:563: error: expected declaration specifiers or '...' before 'pid_t'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:581: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rb_fork'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:582: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rb_fork_err'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:584: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rb_waitpid'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:585: error: expected ')' before 'pid'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:586: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rb_spawn'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:587: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rb_spawn_err'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:589: error: expected ')' before 'pid'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:708: error: expected declaration specifiers or '...' before 'uint32_t'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:833: error: expected ')' before 'long'
/Users/pills/.rvm/rubies/ruby-1.9.3-p448/include/ruby-1.9.1/ruby/intern.h:834: error: expected ')' before 'long'
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

1 个答案:

答案 0 :(得分:1)

我没有要求JDK8,我做了:

xcode-select --install
gem install atomic -v '1.1.14

它有效。