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
If you are using rvm
like me, the fix could a simple:
rvm get stable
rvm reload
As stated in this answer https://apple.stackexchange.com/a/192513
On my case I was trying to run pristine --all
but I was getting:
Ignoring ffi-1.11.1 because its extensions are not built. Try: gem pristine ffi --version 1.11.1
Ignoring jaro_winkler-1.5.3 because its extensions are not built. Try: gem pristine jaro_winkler --version 1.5.3
Ignoring psych-3.1.0 because its extensions are not built. Try: gem pristine psych --version 3.1.0
/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': incompatible library version - /.gem/gems/psych-3.1.0/lib/psych.bundle (fatal)
Then, I deleted the content on Users/{{user.name}}/.gem
then as I needed to run bundle install --force
, it reinstalled everything, then the command pristine --all
worked as expected
If the Ruby directory is invoked or environment vars point to a symlink'ed directory, or are copied or renamed, this message is likely. I am using chruby and was symlinking /opt/rubies/
-> /usr/local/ruby/
, but Ruby's dynamic library-finding logic doesn't play well with this.
The solution in my case was to replace the symlink with actual rubies in /opt/rubies/
and run gem pristine --all
in each Ruby. For others using RVM or Rbenv, good luck with that without starting over from scratch.
This may not be your exact issue, but hopefully it helps.
This is an old thread, but I just came across this issue myself.
You don't need to restart your machine, you just need to refresh your environment, you can do this with the rehash command:
rehash
From the man page: rehash command re-computes the internal hash table of the contents of directories listed in the path environmental variable to account for new commands added.
I had this problem but only when I was starting tmux
session using tmuxinator
.
Turned out it's because I'm using tmuxinator
from brew
instead of installing it using gem install
. Maybe using chruby
at the same time contributed to the problem as well.
p/s: I also removed unused ruby from ~/.gem/ruby
but I doubt that's the reason this issue was resolved for me.
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.