Ignoring GEM because its extensions are not built
Solution 1
I came across this exact issue today - getting warnings like this for gems that weren't even installed!
... Well, it turns out the gems were installed - for a different ruby than the one I had set active with chruby (2.2.3 vs 2.3.1).
Switching to all the different rubies and running gem pristine --all on all of them solved the problem.
Solution 2
I ran into this issue and followed all the same commands as above, even going so far as to remove all my previously installed Ruby versions. However, the error persisted.
Turns out, there were some leftover gems for the various (previously uninstalled) versions in ~/.gem/ruby/. After removing the folders I no longer used, the errors disappeared.
Solution 3
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
Solution 4
I did everything mentioned above including
- xcode-select --install
- reinstall ruby
- reinstall all gems
- gem pristine --all
but the issue was the same for me. I just rebooted my Mac as the last hope, and the warning messages are disappeared.
Weird, but if anyone's struggling with this issue after trying everything on StackOverflow, try reboot your machine.
Solution 5
Running gem pristine --all didn't help at first, but then I realized: the script I was running began with the line:
#!/usr/bin/ruby
On my macOS system (Catalina, but I don't think it matters), this points to the Ruby that came with the system, not the one installed by RVM. Running gem pristine --all was fixing up the RVM installation, but my script was calling a different version of Ruby.
The fix for me was to use the env command to call whichever Ruby is specified in the current shell's PATH. Changing the top line of the script to this fixed it:
#!/usr/bin/env ruby
Related videos on Youtube
Phillip Longman
Updated on November 13, 2021Comments
-
Phillip Longman about 1 yearOn both my work and home computers, I recently upgraded Ruby to 2.3.1, using
ruby-install. I usechrubyas my Ruby switcher.I started seeing this warning in my terminal:
Ignoring bcrypt-3.1.11 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.11 Ignoring bcrypt-3.1.10 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.10 Ignoring binding_of_caller-0.7.2 because its extensions are not built. Try: gem pristine binding_of_caller --version 0.7.2 Ignoring byebug-9.0.5 because its extensions are not built. Try: gem pristine byebug --version 9.0.5 Ignoring byebug-5.0.0 because its extensions are not built. Try: gem pristine byebug --version 5.0.0 Ignoring concurrent-ruby-ext-1.0.2 because its extensions are not built. Try: gem pristine concurrent-ruby-ext --version 1.0.2 Ignoring debug_inspector-0.0.2 because its extensions are not built. Try: gem pristine debug_inspector --version 0.0.2On my work, computer, the list was much longer, but easy to resolve. When I tried the suggested
gem pristine GEM, it told me it couldn't find the gem, so I rangem install GEM, and that solved it.At home, nothing is working.
Things I have tried, from common sense and various other Stack questions:
gem pristine GEMgem pristine --all- uninstalling and reinstalling the gem
gem updategem update --systembundle update- uninstalling and reinstalling
bundler - uninstalling and reinstalling
rails(Though, it's not a Rails specific problem.) - deleting
~/.bundle/ - opening
XCodeand letting it install some extensions (It did need to do it, but it didn't fix anything.) - running
brew doctorand solving all the minor issues, thenbrew updateandbrew upgrade gem install curb(I can't imagine what this gem has to do with this issue, but two different people listed it as the last step of their fix to the same warning.)
-
StevenNunez about 6 yearsThis did it for me. rm -rf. I'd previously tried to pristine install all of my gems to no avail. -
Sandro L over 5 yearsThis worked for me doing this only on the current ruby (I use rvm). Maybe this prevents someone from doing too much cleanup ;) -
GDP2 almost 5 yearsSometimesgem pristine --allwill do no good. See this answer on Ask Different for more info. -
Libby almost 5 yearsThanks for sharing the reboot tip. I had the same problem, on a Mac, and was able to resolve just by starting a new terminal session. -
Chris Yim about 4 yearsifgem pristine --allhas permission issues, you should checkwhich ruby.brew link --overwrite ruby && source ~/.bash_profileand rungem pristine --allmay help -
Alex Cohen about 4 yearsNone of those solutions are working for me and I have this same issue. -
rbanffy over 3 yearsWhat OS are you talking about? -
Dee Choksi over 3 yearsJust removing the rvm related stuff fixed this problem for me on macOS
-
Yacc almost 3 yearsrehashorhash -rfor bash is a shell command available on *nix. When the C shell starts, it builds a hash table of all the commands in its path: each command name and its absolute pathname. So, after you start a csh running, if new programs are added to directories along the path, you need to use the shell's rehash command to rebuild its hash table. (cf: docstore.mik.ua/orelly/unix3/upt/ch27_06.htm) -
AleGiovane over 2 yearsgem pristine --all put me into several toubles, I strongly recommend not to use it without care
-
Philippe Delteil about 2 yearsThis solved my problem with msfconsole (aka metasploit) -
Denis Arnaud almost 2 yearsFantastic, that saved my day! I tried everything else mentioned before your answer, and it did not work. Only your procedure made it for me. Thanks! -
omnikron about 1 yearThis fixed it for me too after switching to
asdffromruby-install&chruby -
Ray Oei about 1 yearTHIS! The point is that even with
rbenvI had this issue but I forgot usingrbenv rehashso the internals were still pointing to the system Ruby (macos) instead of the fresh installed one... so much for reading ;-) -
Ram Suthar about 1 yearthis fixed
sudo rm -rf ~/.gem/ruby/ -
thisismydesign 11 monthsIf you just want to get rid of the warnings it's faster to reinstall everything.gem pristine --allis very slow. -
GDP2 11 monthsNote to self - also see this answer: apple.stackexchange.com/a/436672/79496