Canvas LMS安装因thrift错误而失败

时间:2016-08-02 13:01:29

标签: ruby error-handling bundle canvas-lms

我正在尝试按照production start说明安装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 */

1 个答案:

答案 0 :(得分:0)

试试这个:

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

请参阅Can't install thrift gem on OS X El Capitan