I am running a rails app with docker-compose on a m1 mac. Kept getting 2 specific errors,
/usr/local/bundle/gems/bootsnap-1.12.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in `require': cannot load such file -- nokogiri/nokogiri (LoadError)
This is the first one
/usr/local/bundle/gems/nokogiri-1.13.6-aarch64-linux/lib/nokogiri/extension.rb:7:in `require_relative': Error loading shared library ld-linux-aarch64.so.1: No such file or directory (needed by /usr/local/bundle/gems/nokogiri-1.13.6-aarch64-linux/lib/nokogiri/3.1/nokogiri.so) - /usr/local/bundle/gems/nokogiri-1.13.6-aarch64-linux/lib/nokogiri/3.1/nokogiri.so (LoadError)
This is the second one.
The errors started showing after all the gems are installed, I have reinstalled nokogiri countless times, rebuilt the image and container, and made sure bundle installs in my dockerfile as well.
通过将platform: linux/x86_64
添加到我docker-compose.yml
文件中解决了这个问题
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.