docker build error Gem::Ext::BuildError: ERROR: Failed to build gem native extension for mimemagic-0.3.9
Modify the
Dockerfile
to install theshared-mime-info
package. E.g. on Debian-based images:RUN apt-get update && apt-get install -y shared-mime-info
If it still won't work, then you may need to update the
mimemagic
gem. On your host, updatemimemagic
in the Rails app'sGemfile
/Gemfile.lock
. You may need to installshared-mime-info
first: If the host is macOS, you may need to runbrew install shared-mime-info
; if the host is Ubuntu, you may need to runapt-get install shared-mime-info
. Then runbundle update mimemagic
If your
Dockerfile
downloads the Rails app from a repo, push your changes to that repo first. Or, for testing, modify theDockerfile
to copy in the Rails app from the host instead.
If you are using macOS, try the following
brew install shared-mime-info bundle update mimemagic
And the try to bundle your gem file