Home > Software engineering >  Ruby gems installer keeps saying that I am on an incompatible architecture
Ruby gems installer keeps saying that I am on an incompatible architecture

Time:09-23

I was trying to install ocra through ruby gems when it prompted me with this message:

gem install ocra
Ignoring strscan-3.0.4 because its extensions are not built. Try: gem pristine strscan --version 3.0.4

As instructed, I ran the command, gem pristine strscan --version 3.0.4, and tried to install another gem. Unfortunately, when I tried to install rails, with gem install rails

<internal:/Users/myname/.rbenv/versions/3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': dlopen(/Users/myname/.gem/gems/strscan-3.0.4/lib/strscan.bundle, 0x0009): tried: '/Users/myname/.gem/gems/strscan-3.0.4/lib/strscan.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /Users/myname/.gem/gems/strscan-3.0.4/lib/strscan.bundle (LoadError)

What popped out to me was the part where it says "incompatible architecture":

(mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

I ran arch and got back:

arm64

I also tried running gem but got the same error.

Does anyone know how to fix this problem?

CodePudding user response:

Looks like you are trying to run from a Mac, ocra can only be run on Windows, source: https://github.com/larsch/ocra#requirements

  • Related