ruby-on-rails - 无法安装 ruby gem 约翰逊

标签 ruby-on-rails ruby

我正在尝试在 ruby​​ 1.8.7 上安装 johnson 2.0.0pre3 gem,但出现此编译错误:

(stable)$ gem install johnson -v '2.0.0pre3'
Building native extensions.  This could take a while...
ERROR:  Error installing johnson:
    ERROR: Failed to build gem native extension.

    /Users/aaa/.rvm/rubies/ruby-1.8.7-p374/bin/ruby extconf.rb
creating cache ./config.cache
checking host system type... x86_64-apple-darwin12.5.0
checking target system type... x86_64-apple-darwin12.5.0
checking build system type... x86_64-apple-darwin12.5.0
checking for mawk... no
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for c++... c++
checking whether the C++ compiler (c++  ) works... yes
checking whether the C++ compiler (c++  ) is a cross-compiler... no
checking whether we are using GNU C++... yes
checking whether c++ accepts -g... yes
checking for ranlib... ranlib
checking for as... /usr/bin/as
checking for ar... ar
checking for ld... ld
checking for strip... strip
checking for windres... no
checking whether gcc and cc understand -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking how to run the C++ preprocessor... c++ -E
checking for a BSD compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for perl5... no
checking for perl... /usr/bin/perl
checking for minimum required perl version >= 5.006... 5.012004
checking for full perl installation... yes
checking for python... /usr/bin/python
checking for doxygen... :
checking for whoami... /usr/bin/whoami
checking for autoconf... /usr/local/bin/autoconf
checking for unzip... /usr/bin/unzip
checking for zip... /usr/bin/zip
checking for makedepend... /opt/X11/bin/makedepend
checking for xargs... /usr/bin/xargs
checking for pbbuild... no
checking for xcodebuild... /usr/bin/xcodebuild
./configure: line 3686: test: Xcode 5.0.2 Build version 5A3005: integer expression expected
checking for sdp... :
checking for gmake... no
checking for make... /usr/bin/make
checking for X... no
checking whether the compiler supports -Wno-invalid-offsetof... yes
checking whether the compiler supports -Wno-variadic-macros... yes
checking whether ld has archive extraction flags... no
checking that static assertion macros used in autoconf tests work... yes
checking for 64-bit OS... yes
checking for -dead_strip option to ld... yes
checking for ANSI C header files... yes
checking for working const... yes
checking for mode_t... yes
checking for off_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for st_blksize in struct stat... yes
checking for siginfo_t... yes
checking for stdint.h... yes
checking for the size of void*... configure: error: No size found for void*
*** 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
    --without-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/aaa/.rvm/rubies/ruby-1.8.7-p374/bin/ruby
extconf.rb:27: could not run configure (RuntimeError)
    from extconf.rb:23:in `chdir'
    from extconf.rb:23


Gem files will remain installed in /Users/aaa/.rvm/gems/ruby-1.8.7-p374/gems/johnson-2.0.0.pre3 for inspection.
Results logged to /Users/aaa/.rvm/gems/ruby-1.8.7-p374/gems/johnson-2.0.0.pre3/ext/tracemonkey/gem_make.out

什么会导致这种情况? 谢谢!

最佳答案

失败是因为配置用于确定类型大小的代码无效。正是第 7832 行的 return without expression 导致 configure 失败。参见 bug #579689了解详情。


./配置:

   ⋮
7829 int main() {
7830
7831                      int a[sizeof (void*) == $size ? 1 : -1];
7832                      return;
7833
7834 ; return 0; }
   ⋮

关于ruby-on-rails - 无法安装 ruby gem 约翰逊,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20051330/

相关文章:

ruby-on-rails - 如何从 Rails 2.3.5 中的模型渲染部分

ruby-on-rails - 如何在Rails 4中使用Lucene/Solr?

javascript - sprockets//=require 和 browserify-rails require() 之间的区别?

ruby-on-rails - 删除 Rails 表和迁移

ruby-on-rails - Ruby 1.9 中的主要语法变化是什么?

ruby-on-rails - 如何将枚举与复选框 rails 一起使用

ruby-on-rails - 如何在 Rails 中为我的整个应用捕获 ArgumentError?

ruby-on-rails - rails : acts_as_tree and acts_as_sane_tree

ruby - Ruby 中有更准确的 "class methods"术语吗?

mysql - 如何在没有模型的情况下从 Rails 应用程序查询 MySQL 数据库?