i386 arch error installing old scrypt gem version with OS X Mojave

前端 未结 4 415
死守一世寂寞
死守一世寂寞 2020-12-18 21:48

I\'m trying to install an old gem version for an old project after a fresh install of OS X 10.14 Mojave and XCode Command Line Tools. The gem I\'m trying to install is scryp

相关标签:
4条回答
  • 2020-12-18 22:15

    Installing the command line tools for 10.13 fixed this for me.

    0 讨论(0)
  • 2020-12-18 22:17

    I was experiencing this exact problem.

    I'm running Mojave (10.14.4) and Version 10.2 of the XCode Command Line Tools, and when running gem install scrypt -v 1.2.1, I was getting the exact same error as described above.

    The solution was to install this package: /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg (as described in Can't compile C program on a Mac after upgrade to Mojave). Apparently the root of the issue was that somewhere in this process (bundler? scrypt?) there was an expectation that header files could be found in /usr/include. The latest version of XCode does not place header files in that location, but running the package places them there (as documented in the XCode release notes)

    0 讨论(0)
  • 2020-12-18 22:21

    It looks like the i386 architecture is deprecated & removed for the newest version of macOS. There are still at least 2 options that might work for you, assuming you're unable to upgrade your scrypt version (which is probably the best option)

    • Use a docker image. I just tested with ruby:2.5.3-slim, and you only need to run apt-get update && apt-get build-essential && gem install scrypt -v 1.2.1
    • Download the older SDK, which includes the i386 architecture, and install it on your system. This has some links and info that might be useful (though not rails-specific)
    0 讨论(0)
  • 2020-12-18 22:21

    I tried all the versions of answers given, it did not exactly do the job for me. Then the following steps worked for me.

    First check if the header files are present.

    ls /usr/include
    ls: /usr/include: No such file or directory
    

    As the headers were not present, I removed CommandLineTools, like given in this answer

    sudo rm -rf /Library/Developer/CommandLineTools
    

    Update xcode and install the macOS_SDK_headers_for_macOS_10.14.pkg

    xcode-select --install
    open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
    

    Now the header files were present when I did ls /usr/include

    gem install scrypt -v 1.2.1

    0 讨论(0)
提交回复
热议问题