0

I am trying to install Canvas LMS following the production start instructions. At the point of bundle install, it failed on Thrift installation. I am using Ubuntu 16.04 on a docker in a Mac System. Everything was working fine, but this error has stopped me to start the system. Please help me!

    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

The output from mkmf.log is,

"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 */
markE
  • 102,905
  • 11
  • 164
  • 176
TheRimalaya
  • 4,232
  • 2
  • 31
  • 37

1 Answers1

0

Try this:

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

See Can't install thrift gem on OS X El Capitan

Community
  • 1
  • 1
Nick Urban
  • 3,568
  • 2
  • 22
  • 36