我在 ruby 版本 2.1.10、OSX El Capitan 中遇到此问题,错误描述如下:
安装带有 native 扩展的 bcrypt-ruby 3.1.2
Gem::Ext::BuildError: 错误: 无法构建 gem native 扩展。
checking for ruby/util.h... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling bcrypt_ext.c
compiling crypt.c
compiling crypt_blowfish.c
compiling crypt_gensalt.c
compiling wrapper.c
linking shared-object bcrypt_ext.bundle
ld: warning: directory not found for option '- L/Users/travis/.sm/pkg/active/lib'
make "DESTDIR=" install
make: /usr/local/bin/gmkdir: No such file or directory
make: *** [.RUBYARCHDIR.time] Error 1
make install failed, exit code 2
最佳答案
在 OS X El Capitan 中升级到 Ruby 2.1.x 时: 对于要构建的某些 native 扩展,您需要确保安装了 coreutils 包。
要执行此操作:
brew 安装 coreutils
这也可能导致 raindrops、pg、kgio、http_parser、fast-stemmer、unf_ext、ffi、debug-inspector 和 nokogiri 出现类似的故障
关于ruby-on-rails - bcrypt-ruby 3.1.2 Gem::Ext::BuildError: 错误: 无法在 OSX 中构建 gem native 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37602947/