安装rails时出现异常

时间:2016-06-25 17:52:57

标签: ruby-on-rails ruby opensuse

I am getting following exception while installing rails in Opensuse.
Version of Ruby is ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-linux-gnu]

/usr/lib64/ruby/gems/2.1.0/gems/nokogiri-1.6.8/test/xslt/test_custom_functions.rb
/usr/lib64/ruby/gems/2.1.0/gems/nokogiri-1.6.8/test/xslt/test_exception_handling.rb
/usr/lib64/ruby/gems/2.1.0/gems/nokogiri-1.6.8/test_all
Building native extensions.  This could take a while...
current directory: /usr/lib64/ruby/gems/2.1.0/gems/nokogiri-1.6.8/ext/nokogiri
/usr/bin/ruby.ruby2.1 -r ./siteconf20160625-7943-34np6o.rb extconf.rb
Using pkg-config version 1.1.7
checking if the C compiler accepts ... *** 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}/lib64
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/ruby.ruby2.1
        --help
        --clean
/usr/lib64/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from /usr/lib64/ruby/2.1.0/mkmf.rb:571:in `block in try_compile'
        from /usr/lib64/ruby/2.1.0/mkmf.rb:522:in `with_werror'
        from /usr/lib64/ruby/2.1.0/mkmf.rb:571:in `try_compile'
        from extconf.rb:138:in `nokogiri_try_compile'
        from extconf.rb:162:in `block in add_cflags'
        from /usr/lib64/ruby/2.1.0/mkmf.rb:621:in `with_cflags'
        from extconf.rb:161:in `add_cflags'
        from extconf.rb:414:in `<main>'
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.

    Building has failed. See above output for more information on the failure.

要查看此扩展无法编译的原因,请查看mkmf.log,可在此处找到:

/usr/lib64/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/nokogiri-1.6.8/mkmf.log

extconf失败,退出代码1

mkmf.log的内容如下:

gcc -o conftest -I/usr/include/ruby-2.1.0/x86_64-linux-gnu -I/usr/include /ruby-2.1.0/ruby/backward -I/usr/include/ruby-2.1.0 -I.    -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fno-strict-aliasing -fPIC  conftest.c  -L. -L/usr/lib64 -L. -fstack-protector -rdynamic -Wl,-export-dynamic     -lruby2.1  -lpthread -ldl -lcrypt -lm   -lc "
checked program was:



/* begin */
 1: #include "ruby.h"
 2:
 3: int main(int argc, char **argv)
 4: {
 5:   return 0;
 6: }
 /* end */

0 个答案:

没有答案