在我的工作电脑和家用电脑上,我最近使用Ruby -install将Ruby升级到2.3.1。我使用chruby作为Ruby切换器。

我开始在我的终端上看到这样的警告:

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.2

在我的工作电脑上,清单要长得多,但很容易解决。当我尝试建议的gem原始gem时,它告诉我找不到宝石,所以我运行gem安装gem,这就解决了问题。

在家里,一切都不正常。

我从常识和其他Stack问题中尝试过的事情:

gem pristine GEM gem pristine --all uninstalling and reinstalling the gem gem update gem update --system bundle update uninstalling and reinstalling bundler uninstalling and reinstalling rails (Though, it's not a Rails specific problem.) deleting ~/.bundle/ opening XCode and letting it install some extensions (It did need to do it, but it didn't fix anything.) running brew doctor and solving all the minor issues, then brew update and brew 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.)


当前回答

我遇到了这个问题,并执行了与上面相同的所有命令,甚至删除了之前安装的所有Ruby版本。然而,错误仍然存在。

事实证明,在~/.gem/ruby/中有一些剩余的宝石用于各种(以前卸载的)版本。删除我不再使用的文件夹后,错误就消失了。

其他回答

卸载和重新安装的流浪者也工作。有一个卸载。工具bash脚本包含在安装程序的.dmg映像中,将删除Vagrant。

发现这个解决方案在这里:更新流浪者和宝石扩展不内置

如果您已经安装了RVM,则可能因为安装了不同的版本而捕捉到错误。

检查和删除无用的版本, 但我认为这不是一个好方法。 不管怎样,错误消失了。

rvm list
rvm use ruby-version
rvm remove ruby-useless-version

刷新cocoapods后,应该将其注入到.rvm GEM_HOME中

gem uninstall cocoapods
gem install cocoapods

可能pod COMMAND会抛出关于minitest gem的错误,所以- gem install minitest

在这里加入我自己的口味。我使用通过Homebrew安装的rbenv,得到了四个这样的“忽略…”没有构建扩展”的消息。具体地说:

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

我在这个帖子里尝试了很多东西,但都不走运。最后在我的例子中,我做到了:

酿造卸载rbenv Rm -rf ~/.rbenv 编译安装rbenv

在这一点上,我仍然得到错误,但现在我只有一个Ruby版本的竞争:

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

在这一点上,我尝试了sudo gem质朴——但被拒绝对系统Gems目录的权限。

所以我仔细检查了每一颗宝石,就像

Sudo gem primitive bcrypt -version 3.1.12 (etc)

最后,错误消失了。

在我的例子中,警告本身已经给出了解决方案,所以我只是一个一个地运行它们。

Ignoring bigdecimal-2.0.0 because its extensions are not built. Try: gem pristine bigdecimal --version 2.0.0
Ignoring date-3.0.1 because its extensions are not built. Try: gem pristine date --version 3.0.1
Ignoring dbm-1.1.0 because its extensions are not built. Try: gem pristine dbm --version 1.1.0
Ignoring etc-1.1.0 because its extensions are not built. Try: gem pristine etc --version 1.1.0

这里有一个例子:

gem pristine bigdecimal --version 2.0.0

因此,运行每一行的命令就解决了我的问题。

我在Terminal中执行了这些命令,并为我工作:

/usr/bin/ruby -e "$(curl - ssl https://raw.githubusercontent.com/Homebrew/install/master/install)" Brew安装ruby,可能需要sudo (sudo Brew install ruby)。 echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile . bat 源~ / . bash_profile Sudo宝石原始——全部