SlatherOrg / slather

Generate test coverage reports for Xcode projects & hook it into CI.
MIT License
1.55k stars 236 forks source link

nokogiri error on new macbook M1 #485

Open truong15 opened 3 years ago

truong15 commented 3 years ago

I'm trying to run bundle exec slather on new MacBook Pro M1 and an error occurred. Can not load gem nokogiri.

The dependency gem nokogiri has prerelease supports for arm64 but slather. Can we have a prerelease like them?

Stacey-snappymob commented 2 years ago

Is there any updates on this issue?

viikufa commented 2 years ago

Did you try run with arch? arch -arch x86_64 bundle exec slather

PavelStepanovTomorrow commented 2 years ago

@viikufa has the same problem as discussed above. Tried arch -arch x86_64 bundle exec slather with no success

bundler: failed to load command: slather (/Users/cicd/builds/EWvUpCpc/0/mobile/mobile-ios-app/vendor/bundle/ruby/2.6.0/bin/slather)
9104/Users/cicd/builds/EWvUpCpc/0/mobile/mobile-ios-app/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.12.5/lib/nokogiri/extension.rb:30:in `require': dlopen(/Users/cicd/builds/EWvUpCpc/0/mobile/mobile-ios-app/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.12.5/lib/nokogiri/nokogiri.bundle, 0x0009): tried: '/Users/cicd/builds/EWvUpCpc/0/mobile/mobile-ios-app/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.12.5/lib/nokogiri/nokogiri.bundle' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/nokogiri.bundle' (no such file) - /Users/cicd/builds/EWvUpCpc/0/mobile/mobile-ios-app/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.12.5/lib/nokogiri/nokogiri.bundle (LoadError)
bspinner commented 2 years ago

As a workaround, try setting force_ruby_platform:

bundle config set force_ruby_platform true

From docs:

force_ruby_platform (BUNDLE_FORCE_RUBY_PLATFORM): Ignore the current machine's platform and install only ruby platform gems. As a result, gems with native extensions will be compiled from source.