instructure / canvas-lms

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

Bundle Install fails during psych 5.1.2 and idn-ruby 0.1.5 #2321

Closed 2SIX6 closed 4 months ago

2SIX6 commented 4 months ago

Summary:

while attempting to do initial bundle install following production guidelines, bundler fails

prerequisites:

Steps to reproduce:

  1. Follow guidelines to install canvas-lms production deployment
  2. Get to the part where you use bundler to install dependencies
  3. Initiate command 'bundle install'

Expected behavior:

Bundler compiles all assets and dependencies

Actual behavior:

cellison@canvas:/var/canvas$ bundle install Resolving dependencies... Fetching gem metadata from https://rubygems.org/........ Installing psych 5.1.2 with native extensions Installing idn-ruby 0.1.5 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/canvas/vendor/bundle/ruby/3.1.0/gems/idn-ruby-0.1.5/ext

/home/cellison/.rbenv/versions/3.1.4/bin/ruby -I /home/cellison/.rbenv/versions/3.1.4/lib/ruby/3.1.0 extconf.rb checking for -lidn... no ERROR: could not find idn library!

Please install the GNU IDN library or alternatively specify at least one of the following options if the library can only be found in a non-standard location: --with-idn-dir=/path/to/non/standard/location or --with-idn-lib=/path/to/non/standard/location/lib --with-idn-include=/path/to/non/standard/location/include

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/cellison/.rbenv/versions/3.1.4/bin/$(RUBY_BASE_NAME) --with-libidn-dir --without-libidn-dir --with-libidn-include --without-libidn-include=${libidn-dir}/include --with-libidn-lib --without-libidn-lib=${libidn-dir}/lib --with-libidn-config --without-libidn-config --with-pkg-config --without-pkg-config --with-idn-dir --without-idn-dir --with-idn-include --without-idn-include=${idn-dir}/include --with-idn-lib --without-idn-lib=${idn-dir}/lib --with-idnlib --without-idnlib

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

/var/canvas/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/idn-ruby-0.1.5/mkmf.log

extconf failed, exit code 1

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

/home/cellison/.rbenv/versions/3.1.4/lib/ruby/3.1.0/rubygems/ext/builder.rb:102:in run' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:28:inbuild' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/3.1.0/rubygems/ext/builder.rb:171:in build_extension' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/3.1.0/rubygems/ext/builder.rb:205:inblock in build_extensions' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/3.1.0/rubygems/ext/builder.rb:202:in each' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/3.1.0/rubygems/ext/builder.rb:202:inbuild_extensions' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/3.1.0/rubygems/installer.rb:843:in build_extensions' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/rubygems_gem_installer.rb:76:inbuild_extensions' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/rubygems_gem_installer.rb:28:in install' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/source/rubygems.rb:205:ininstall' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/installer/gem_installer.rb:54:in install' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/installer/gem_installer.rb:16:ininstall_from_spec' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/installer/parallel_installer.rb:132:in do_install' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/installer/parallel_installer.rb:123:inblock in worker_pool' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/worker.rb:62:in apply_func' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/worker.rb:57:inblock in process_queue' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/worker.rb:54:in loop' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/worker.rb:54:inprocess_queue' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/worker.rb:90:in `block (2 levels) in create_threads'

An error occurred while installing idn-ruby (0.1.5), and Bundler cannot continue.

In Gemfile: canvas_quiz_statistics was resolved to 0.1.0, which depends on html_text_helper was resolved to 0.0.1, which depends on twitter-text was resolved to 3.1.0, which depends on idn-ruby

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

current directory: /var/canvas/vendor/bundle/ruby/3.1.0/gems/psych-5.1.2/ext/psych

/home/cellison/.rbenv/versions/3.1.4/bin/ruby -I /home/cellison/.rbenv/versions/3.1.4/lib/ruby/3.1.0 extconf.rb checking for yaml.h... no yaml.h not found 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/cellison/.rbenv/versions/3.1.4/bin/$(RUBY_BASE_NAME) --with-libyaml-source-dir --without-libyaml-source-dir --with-yaml-0.1-dir --without-yaml-0.1-dir --with-yaml-0.1-include --without-yaml-0.1-include=${yaml-0.1-dir}/include --with-yaml-0.1-lib --without-yaml-0.1-lib=${yaml-0.1-dir}/lib --with-yaml-0.1-config --without-yaml-0.1-config --with-pkg-config --without-pkg-config --with-libyaml-dir --without-libyaml-dir --with-libyaml-include --without-libyaml-include=${libyaml-dir}/include --with-libyaml-lib --without-libyaml-lib=${libyaml-dir}/lib

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

/var/canvas/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/psych-5.1.2/mkmf.log

extconf failed, exit code 1

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

/home/cellison/.rbenv/versions/3.1.4/lib/ruby/3.1.0/rubygems/ext/builder.rb:102:in run' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:28:inbuild' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/3.1.0/rubygems/ext/builder.rb:171:in build_extension' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/3.1.0/rubygems/ext/builder.rb:205:inblock in build_extensions' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/3.1.0/rubygems/ext/builder.rb:202:in each' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/3.1.0/rubygems/ext/builder.rb:202:inbuild_extensions' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/3.1.0/rubygems/installer.rb:843:in build_extensions' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/rubygems_gem_installer.rb:76:inbuild_extensions' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/rubygems_gem_installer.rb:28:in install' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/source/rubygems.rb:205:ininstall' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/installer/gem_installer.rb:54:in install' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/installer/gem_installer.rb:16:ininstall_from_spec' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/installer/parallel_installer.rb:132:in do_install' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/installer/parallel_installer.rb:123:inblock in worker_pool' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/worker.rb:62:in apply_func' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/worker.rb:57:inblock in process_queue' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/worker.rb:54:in loop' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/worker.rb:54:inprocess_queue' /home/cellison/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.5.3/lib/bundler/worker.rb:90:in `block (2 levels) in create_threads'

An error occurred while installing psych (5.1.2), and Bundler cannot continue.

In Gemfile: debug was resolved to 1.9.1, which depends on irb was resolved to 1.11.1, which depends on rdoc was resolved to 6.6.2, which depends on psych

Additional notes:

looking at the log files, the script is looking for a file 'yaml.h' that it does not find and exits with error.

amg-web commented 4 months ago

yaml.h not found

do you have libyaml-dev installed?

2SIX6 commented 4 months ago

I thought I did, but evidently I did not after running apt-get install libyaml-dev. However after installing and rebooting for kernel update rerunning the bundle install command in /var/canvas yields the same error

2SIX6 commented 4 months ago

Found the error, libidn11-dev did not correctly install when running the command the first time. after installing I was able to successfully complete the bundle install. Marking resolved.