ruby - 安装 crypt (3.1.7) 时出错

标签 ruby rubygems bundle bundler bcrypt

我在运行 sudo bundle install 时收到一条错误消息:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 
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
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [bcrypt_ext.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/bcrypt-3.1.7 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/bcrypt-3.1.7/gem_make.out
An error occurred while installing bcrypt (3.1.7), and Bundler cannot continue.
Make sure that `gem install bcrypt -v '3.1.7'` succeeds before bundling.

然后我尝试运行 sudo gem install bcrypt -v '3.1.7' 并收到以下错误消息:

Building native extensions.  This could take a while...
ERROR:  Error installing bcrypt:
    ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
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
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [bcrypt_ext.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/bcrypt-3.1.7 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/bcrypt-3.1.7/gem_make.out

在此之后,我尝试运行 sudo gem install bcrypt,但仍然无法正常工作。有什么建议吗?

最佳答案

我已经从 Mac App Store 升级了 Xcode,这导致了我这个特殊的错误。

在我的情况下修复它的方法:运行 Xcode 并接受许可条款等。然后当我运行 bundle install 时,它编译并安装了 bcrypt 就好了.

关于ruby - 安装 crypt (3.1.7) 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22909981/

相关文章:

ruby-on-rails - 将模型上的所有方法调用委托(delegate)给关联

ruby-on-rails - 我如何找出哪个版本的游戏适合哪个版本的 ruby​​ 和 rails?

ruby-on-rails - Bundler 找不到 gem "rack": 的兼容版本

c# - asp.net mvc Bundle.IncludeDirectory 示例?

javascript - VS 2013 web Essentials js 包忽略输出文件名

ruby-on-rails - Rails 方法在没有 session 的情况下限制页面访问

ruby - 在类方法中使用和不使用 self 调用 Ruby 类方法有什么区别吗?

ruby - 如何复制 ruby 变量?

java - 未知错误 - bundle 字符串数组