instructure / canvas-lms

The open LMS by Instructure, Inc.
https://github.com/instructure/canvas-lms/wiki
GNU Affero General Public License v3.0
5.52k stars 2.45k forks source link

Ubuntu 20 thrift gem #2046

Open jonxduo opened 2 years ago

jonxduo commented 2 years ago

I tried to install canvas-lms in ubuntu 20.04

I can't install the thrift gem

An error occurred while installing thrift (0.9.3.0), and Bundler cannot continue.
Make sure that `gem install thrift -v '0.9.3.0' --source 'https://rubygems.org/'` succeeds before bundling.

I tried: ~/canvas$ bundle config build.thrift --with-cppflags='-D_FORTIFY_SOURCE=0' gem install thrift -v 0.8.0 -- --with-cppflags=\"-D_FORTIFY_SOURCE=0 -Wno-shift-negative-value\" ~/canvas$ bundle config build.eventmachine --with-cppflags=-I/usr/local/opt/openssl/include

respond:

Building native extensions with: '--with-cppflags="-D_FORTIFY_SOURCE=0 -Wno-shift-negative-value"'
This could take a while...
ERROR:  Error installing thrift:
    ERROR: Failed to build gem native extension.

    current directory: /home/jxd/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/thrift-0.8.0/ext
/home/jxd/.rbenv/versions/2.4.0/bin/ruby -I /home/jxd/.rbenv/versions/2.4.0/lib/ruby/site_ruby/2.4.0 -r ./siteconf20220415-50632-15cgrng.rb extconf.rb --with-cppflags\=\"-D_FORTIFY_SOURCE\=0 -Wno-shift-negative-value\"
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=/home/jxd/.rbenv/versions/2.4.0/bin/$(RUBY_BASE_NAME)
/home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:457:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:542:in `try_link0'
    from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:557:in `try_link'
    from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:768:in `try_func'
    from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:1055:in `block in have_func'
    from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:945:in `block in checking_for'
    from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:351:in `block (2 levels) in postpone'
    from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:321:in `open'
    from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:351:in `block in postpone'
    from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:321:in `open'
    from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:347:in `postpone'
    from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:944:in `checking_for'
    from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:1054: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:

  /home/jxd/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0/thrift-0.8.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/jxd/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/thrift-0.8.0 for inspection.
Results logged to /home/jxd/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0/thrift-0.8.0/gem_make.out
jonxduo commented 2 years ago

I try with ubuntu 18.04 and debian 11 I can't install canvas-lms

Installing thrift 0.9.3.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/jxd/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/thrift-0.9.3.0/ext
/home/jxd/.rbenv/versions/2.4.0/bin/ruby -I /home/jxd/.rbenv/versions/2.4.0/lib/ruby/site_ruby/2.4.0 -r ./siteconf20220417-4132-wc9kcv.rb
extconf.rb
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=/home/jxd/.rbenv/versions/2.4.0/bin/$(RUBY_BASE_NAME)
/home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:457:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:542:in `try_link0'
from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:557:in `try_link'
from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:768:in `try_func'
from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:1055:in `block in have_func'
from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:945:in `block in checking_for'
from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:351:in `block (2 levels) in postpone'
from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:321:in `open'
from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:351:in `block in postpone'
from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:321:in `open'
from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:347:in `postpone'
from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:944:in `checking_for'
from /home/jxd/.rbenv/versions/2.4.0/lib/ruby/2.4.0/mkmf.rb:1054:in `have_func'
from extconf.rb:31:in `<main>'

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

  /home/jxd/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0/thrift-0.9.3.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/jxd/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/thrift-0.9.3.0 for inspection.
Results logged to /home/jxd/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0/thrift-0.9.3.0/gem_make.out

An error occurred while installing thrift (0.9.3.0), and Bundler cannot continue.
Make sure that `gem install thrift -v '0.9.3.0' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  event_stream was resolved to 0.0.1, which depends on
    canvas_cassandra was resolved to 0.0.1, which depends on
      cassandra-cql was resolved to 1.2.3, which depends on
        thrift_client was resolved to 0.9.3, which depends on
          thrift