Ignoring GEM because its extensions are not built

前端 未结 18 1349
陌清茗
陌清茗 2020-12-04 06:35

On both my work and home computers, I recently upgraded Ruby to 2.3.1, using ruby-install. I use chruby as my Ruby switcher.

I started seei

相关标签:
18条回答
  • 2020-12-04 07:05

    This is also a problem when you're developing on Mac and then build a Docker image: https://forums.aws.amazon.com/thread.jspa?messageID=879802&tstart=0

    When you do a "bundle install --deployment", bundler will create a vendor directory w/ your gems in it. Note that whilst this includes your gems in the local folder, it will only include the native extensions for your platform. As you're on macOS this will be Darwin. You'll need to do repeat the process on a 64-bit x86 linux environment.

    0 讨论(0)
  • 2020-12-04 07:07

    Adding my own flavor here. I use rbenv installed via Homebrew and was getting four of these "ignoring... extensions not built" messages. Specifically:

    Ignoring bcrypt-3.1.12 because its extensions are not built.  Try: gem pristine bcrypt --version 3.1.12
    Ignoring bindex-0.5.0 because its extensions are not built.  Try: gem pristine bindex --version 0.5.0
    Ignoring bootsnap-1.3.2 because its extensions are not built.  Try: gem pristine bootsnap --version 1.3.2
    Ignoring byebug-10.0.2 because its extensions are not built.  Try: gem pristine byebug --version 10.0.2
    

    I tried many things in this thread with no luck. Finally in my case I did:

    • brew uninstall rbenv
    • rm -rf ~/.rbenv
    • brew install rbenv

    At this point I was still getting the errors, but now I had only a single Ruby version to contend with:

    $ rbenv versions
    * system (set by /Users/will/.rbenv/version)
    

    At this point I tried sudo gem pristine --all but was rejected for permissions on the system Gems directory.

    So I went through and ran pristine on each gem, like

    sudo gem pristine bcrypt --version 3.1.12 (etc)

    And finally the errors were gone.

    0 讨论(0)
  • 2020-12-04 07:10

    Libby's suggestion to just start a new terminal session (which she commented on Sebastian Kim's answer) worked for me. Much quicker than any of the others too so I wanted to make it an answer so it was more visible.

    0 讨论(0)
  • 2020-12-04 07:16

    I've had this problem today too and it frustrated because I couldn't type because my whole editor flashed red with error messages.

    I'm not entirely sure what exactly caused it but I believe it's because we have multiple ruby versions OR multiple ruby version managers installed and they overwrite each other and otherwise mess up your paths towards the gems.

    The gem command also gets overwritten when you have rbenv and rvm.

    See which ones you've installed by typing;

    which rvm
    which rbenv
    which chruby
    

    If one of those is installed it'll return a path. Then delete them, make sure to completely clean out all the directories and start with a clean install.


    Remove

    Here's what I did for rvm;

    rvm implode
    gem uninstall rvm
    rm -rf ~/.rvm
    rm -rf ~/.rvmrc
    

    Here's what I did for rbenv

    First installed https://github.com/meowsus/rbenv-clean, then

    rbenv clean
    sudo apt-get remove rbenv
    rm -rf ~/.rbenv
    

    Reinstall

    Then you have a clean home directory to work from. I reïnstalled rbenv with How to install Ruby 2.1.4 on Ubuntu 14.04. And finally;

    rbenv rehash
    
    0 讨论(0)
  • 2020-12-04 07:16

    Running Mac OS Catalina, brew and rbenv ...

    Having come across this exact problem today, and gone through all the answers here I eventually stumbled across another reason for this error:

    Ignoring nokogiri 1.10.7 because its extensions are not built. Try: gem pristine nokogiri --version 1.10.7

    And of course gem pristine did no work.

    My problem was a hard coded GEM_HOME and GEM_PATH environment variables which were overriding rbenv.

    So, check that you haven't set GEM_PATH and GEM_HOME in ~/.zshrc

    0 讨论(0)
  • 2020-12-04 07:16

    This solution worked for me for RubyMine IntelliJ

    I had two different terminals being used and RVM and ruby<Version>.

    Solution:

    I had to switch it to the RVM version for the errors to go away in Preferences>Languages&Frameworks>Ruby SDK

    Errors:

    Ignoring executable-hooks-1.6.0 because its extensions are not built. Try: gem pristine executable-hooks --version 1.6.0 rubymine
    
    Ignoring gem-wrappers-1.4.0 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.4.0
    

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