katana
katana copied to clipboard
ERROR [ 3/22] RUN gem install rdoc --no-document
Hi, I when I try to build the docker image, got this error, on my m1 chip macOS
=> ERROR [ 3/22] RUN gem install rdoc --no-document 1.3s
------
> [ 3/22] RUN gem install rdoc --no-document:
#7 1.277 Building native extensions. This could take a while...
#7 1.318 ERROR: Error installing rdoc:
#7 1.318 ERROR: Failed to build gem native extension.
#7 1.318
#7 1.318 current directory: /var/lib/gems/2.7.0/gems/psych-4.0.5/ext/psych
#7 1.318 /usr/bin/ruby2.7 -I /usr/lib/ruby/vendor_ruby -r ./siteconf20220922-7-b1g1wo.rb extconf.rb
#7 1.318 mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
#7 1.318
#7 1.318 You might have to install separate package for the ruby development
#7 1.318 environment, ruby-dev or ruby-devel for example.
#7 1.318
#7 1.318 extconf failed, exit code 1
#7 1.318
#7 1.318 Gem files will remain installed in /var/lib/gems/2.7.0/gems/psych-4.0.5 for inspection.
#7 1.318 Results logged to /var/lib/gems/2.7.0/extensions/aarch64-linux/2.7.0/psych-4.0.5/gem_make.out
------
executor failed running [/bin/sh -c gem install rdoc --no-document]: exit code: 1
I add following lines to Dockerfile line 17-18 and error gone.
RUN apt-get update && apt-get install -y ruby ruby-dev ruby-bundler build-essential
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*