ERROR: Error installing ffi: ERROR: Failed to build gem native extension

后端 未结 15 1565
春和景丽
春和景丽 2020-12-03 14:12

Got the DevKit installed and re-ran the ffi install….got this as an output:

C:\\Documents and Settings\\******>gem install ffi
Temporarily enhancing PATH          


        
相关标签:
15条回答
  • 2020-12-03 14:45

    you need this,

    apt-get install ruby2.2-dev
    
    0 讨论(0)
  • 2020-12-03 14:46

    The gem install ffi fails due to the gem trying to build a bundled copy of libffi, which does not work due to assumptions that /usr/bin/env exists and too old libffi copy.

    However, you can build the ffi gem against the system libffi - install the packages:

    apt install clang make ruby-dev libffi-dev
    

    After that the ffi gem should build:

    gem install ffi
    
    0 讨论(0)
  • 2020-12-03 14:48
    sudo apt-get install libffi-dev
    

    This worked for me

    0 讨论(0)
  • 2020-12-03 14:50

    Copied from another post:

    As stated in Issue with installing ImageMagick and rmagick on Mountain Lion, ffi appears to be configured to look for 'gcc-4.2', so once I updated my Apple command line tools (which I may or may not have needed to do), I created a symbolic link to make the ffi install configuration happy:

    sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
    
    0 讨论(0)
  • 2020-12-03 14:53

    Version 1.0.10 has issues compiling on windows.

    You can use the 1.0.9

    gem install ffi --version='1.0.9'
    
    0 讨论(0)
  • 2020-12-03 14:56

    For me the fix was running in this order. I'm not sure what all was relevant, but it worked:

    gem install ffi --version '1.0.9'
    

    The above failed, but then I could successfully run:

    gem install bundler
    

    ...and subsequently:

    gem install ffi
    

    ...which got the latest version (1.6.0 at the time of writing this) and installed it successfully.

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