ruby-on-rails - bcrypt-ruby 3.1.2 Gem::Ext::BuildError: 错误: 无法在 OSX 中构建 gem native 扩展

标签 ruby-on-rails ruby macos

我在 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/

相关文章:

ruby-on-rails - 如何在 angularjs 中使用原生 anchor 链接

ruby-on-rails - SongsController 中的 NameError#index 未初始化常量 Song::FriendlyId

ruby-on-rails - Postgres Rails 4 搜索查询 ID 或多列

ruby-on-rails - 为什么 'FactoryGirl.lint' 给出 InvalidFactoryError?

ruby - 使用 File.open 在 Ruby 中设置文件权限

ios - 如何在 Xcode 中更改 UITableView 边框颜色

ruby - 安装 rvm rails - 未满足的依赖项 libffi-dev 依赖于 libffi6 - Ubuntu 14.04.4 LTS

ruby - 如何使用 Ruby 的邮件 gem 通过 smtp 发送电子邮件?

python - 将手动安装的 OpenSSL 1.1.0e 链接到 python2.7

macos - 如何编写MacOS显示驱动程序