error occurred while installing ruby-debug-ide, but only in docker compose build

153 views Asked by At

If I install the ruby-debug-ide Gem by

  1. docker compose run app bash
  2. gem install "ruby-debug-ide"

it installs without issue.

If I install the ruby-debug-ide Gem by

  1. docker compose run app bash
  2. Add ruby-debug-ide to my Gemfile
  3. bundle install

it installs without issue.

After that second attempt there are changes (as expected) to bit my Gemfile and my Gemfile.lock. If I now run docker compose build it crashes out with this error:

#10 14.40 Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
#10 14.40
#10 14.40 current directory: /usr/local/bundle/gems/ruby-debug-ide-0.7.3/ext
#10 14.40 /usr/local/bin/ruby mkrf_conf.rb
#10 14.40 Installing base gem
#10 14.40 Building native extensions. This could take a while...
#10 14.40 Building native extensions. This could take a while...
#10 14.40 ERROR: Failed to build gem native extension.
#10 14.40
#10 14.40 current directory: /usr/local/bundle/gems/debase-0.2.5.beta2/ext
#10 14.40 /usr/local/bin/ruby -I /usr/local/lib/ruby/3.1.0 -r
#10 14.40 ./siteconf20220331-401-hxgkmc.rb extconf.rb
#10 14.40 checking for vm_core.h... no
#10 14.40 checking for vm_core.h... no
#10 14.40 **************************************************************************
#10 14.40 No source for ruby-3.1.1-p18 (revision
53f5fc4236a754ddf94b20dbb70ab63bd5109b18)
#10 14.40 provided with
#10 14.40 debase-ruby_core_source gem. Falling back to ruby-3.1.0-p0.
#10 14.40 **************************************************************************
#10 14.40 checking for vm_core.h... yes
#10 14.40 checking for iseq.h... no
#10 14.40 checking for iseq.h... yes
#10 14.40 checking for version.h... yes
#10 14.40 creating Makefile
#10 14.40
#10 14.40 current directory: /usr/local/bundle/gems/debase-0.2.5.beta2/ext
#10 14.40 make DESTDIR= clean
#10 14.40
#10 14.40 current directory: /usr/local/bundle/gems/debase-0.2.5.beta2/ext
#10 14.40 make DESTDIR=
#10 14.40 compiling breakpoint.c
#10 14.40 compiling context.c
#10 14.40 Assembler messages:
#10 14.40 Fatal error: can't create context.o: No such file or directory
#10 14.40 make: *** [Makefile:246: context.o] Error 1
#10 14.40
#10 14.40 make failed, exit code 2
#10 14.40
#10 14.40 Gem files will remain installed in /usr/local/bundle/gems/debase-0.2.5.beta2 for
#10 14.40 inspection.
#10 14.40 Results logged to
#10 14.40 /usr/local/bundle/extensions/aarch64-linux/3.1.0/debase-0.2.5.beta2/gem_make.out
#10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:95:in run' #10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:44:in block in make'
#10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:36:in each' #10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:36:in make'
#10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:63:in
block in #10 14.40 build' #10 14.40 /usr/local/lib/ruby/3.1.0/tempfile.rb:317:in open'
#10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:26:in
build' #10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:161:in build_extension'
#10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:195:in block in #10 14.40 build_extensions' #10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in each'
#10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in build_extensions' #10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/installer.rb:853:in build_extensions'
#10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/installer.rb:328:in install' #10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/resolver/specification.rb:104:in install'
#10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/request_set.rb:279:in block in #10 14.40 install_into' #10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/request_set.rb:271:in each'
#10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/request_set.rb:271:in install_into' #10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/request_set.rb:147:in install'
#10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/dependency_installer.rb:252:in
install' #10 14.40 mkrf_conf.rb:31:in rescue in '
#10 14.40 mkrf_conf.rb:24:in <main>' #10 14.40 #10 14.40 rake failed, exit code 1 #10 14.40 #10 14.40 Gem files will remain installed in /usr/local/bundle/gems/ruby-debug-ide-0.7.3 #10 14.40 for inspection. #10 14.40 Results logged to #10 14.40 /usr/local/bundle/extensions/aarch64-linux/3.1.0/ruby-debug-ide-0.7.3/gem_make.out #10 14.40 #10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:95:in run'
#10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/ext/rake_builder.rb:11:in build' #10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:161:in build_extension'
#10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:195:in block in #10 14.40 build_extensions' #10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in each'
#10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in build_extensions' #10 14.40 /usr/local/lib/ruby/3.1.0/rubygems/installer.rb:853:in build_extensions'
#10 14.40 /usr/local/lib/ruby/3.1.0/bundler/rubygems_gem_installer.rb:71:in
#10 14.40 build_extensions' #10 14.40 /usr/local/lib/ruby/3.1.0/bundler/rubygems_gem_installer.rb:28:in install'
#10 14.40 /usr/local/lib/ruby/3.1.0/bundler/source/rubygems.rb:204:in install' #10 14.40 /usr/local/lib/ruby/3.1.0/bundler/installer/gem_installer.rb:54:in install'
#10 14.40 /usr/local/lib/ruby/3.1.0/bundler/installer/gem_installer.rb:16:in
#10 14.40 install_from_spec' #10 14.40 /usr/local/lib/ruby/3.1.0/bundler/installer/parallel_installer.rb:186:in #10 14.40 do_install'
#10 14.40 /usr/local/lib/ruby/3.1.0/bundler/installer/parallel_installer.rb:177:in
#10 14.40 block in worker_pool' #10 14.40 /usr/local/lib/ruby/3.1.0/bundler/worker.rb:62:in apply_func'
#10 14.40 /usr/local/lib/ruby/3.1.0/bundler/worker.rb:57:in block in process_queue' #10 14.40 /usr/local/lib/ruby/3.1.0/bundler/worker.rb:54:in loop'
#10 14.40 /usr/local/lib/ruby/3.1.0/bundler/worker.rb:54:in process_queue' #10 14.40 /usr/local/lib/ruby/3.1.0/bundler/worker.rb:91:in block (2 levels) in
#10 14.40 create_threads'
#10 14.40
#10 14.40 An error occurred while installing ruby-debug-ide (0.7.3), and Bundler cannot
#10 14.40 continue.

(Sorry about the long copy-and-paste, I am not sure which part is relevant.)

The part of my Dockerfile that does the actual building is this:

FROM ruby:3.1-slim-bullseye as builder
WORKDIR /app
RUN apt-get update \
    && apt-get upgrade --yes \
    && apt-get install --yes --no-install-recommends \
    build-essential curl git gnupg firefox-esr \
  && curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
  && curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
  && echo 'deb https://deb.nodesource.com/node_16.x bullseye main' > /etc/apt/sources.list.d/nodesource.list \
  && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
  && apt-get update \
  && apt-get install --yes --no-install-recommends nodejs yarn \
  && rm -rf /var/lib/apt/lists/* /var/lib/apt/archives/*.deb
ENV TZ='Europe/London'
ENV RUBYOPT='-W:no-deprecated -W:no-experimental'
ENV PATH="$PATH:node_modules/.bin"
COPY Gemfile Gemfile.lock /app/
RUN bundle install --jobs 4 \
    && bundle binstubs --all --path /usr/local/bundle/bin

Why can I build at a bash prompt in the container but cannot when rebuilding the container?

0

There are 0 answers