0

我正在尝试按照生产开始说明安装 Canvas LMS。在捆绑安装时,它在 Thrift 安装时失败。我在 Mac 系统的 docker 上使用 Ubuntu 16.04。一切正常,但这个错误阻止了我启动系统。请帮我!

    Installing thrift 0.8.0 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /var/canvas/vendor/bundle/ruby/2.3.0/gems/thrift-0.8.0/ext
/usr/bin/ruby2.3 -r ./siteconf20160802-8582-f93j3i.rb extconf.rb --with-cppflags=-D_FORTIFY_SOURCE=0
checking for strlcpy() in string.h... *** 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=/usr/bin/$(RUBY_BASE_NAME)2.3
/usr/lib/ruby/2.3.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/lib/ruby/2.3.0/mkmf.rb:541:in `try_link0'
        from /usr/lib/ruby/2.3.0/mkmf.rb:556:in `try_link'
        from /usr/lib/ruby/2.3.0/mkmf.rb:765:in `try_func'
        from /usr/lib/ruby/2.3.0/mkmf.rb:1051:in `block in have_func'
        from /usr/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
        from /usr/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
        from /usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
        from /usr/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
        from /usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
        from /usr/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'
        from /usr/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'
        from /usr/lib/ruby/2.3.0/mkmf.rb:1050:in `have_func'
        from extconf.rb:27:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/canvas/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/thrift-0.8.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/canvas/vendor/bundle/ruby/2.3.0/gems/thrift-0.8.0 for inspection.
Results logged to /var/canvas/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/thrift-0.8.0/gem_make.out

的输出mkmf.log是,

"gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -D_FORTIFY_SOURCE=0 -g -O2 -Wall -Werror conftest.c  -L. -L/usr/lib/x86_64-linux-\
gnu -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic     -lruby-2.3  -lpthread -lgmp -ldl -lcrypt -lm   -lc"
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>: note: this is the location of the previous definition
cc1: all warnings being treated as errors
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */
4

1 回答 1

0

尝试这个:

gem install thrift -v '0.8.0' -- --with-cppflags='-D_FORTIFY_SOURCE=0'

请参阅无法在 OS X El Capitan 上安装 thrift gem

于 2016-11-02T05:18:09.817 回答