无法安装bcrypt

时间:2015-07-25 15:12:42

标签: ruby-on-rails gcc bcrypt

我正在尝试安装bcrypt,但收到gcc错误:

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

    /Users/username/.rvm/rubies/ruby-2.1.4/bin/ruby -r ./siteconf20150725-48409-euca4n.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling bcrypt_ext.c
gcc: error: unrecognized command line option '-Wshorten-64-to-32'
gcc: error: unrecognized command line option '-Wdivision-by-zero'
gcc: error: unrecognized command line option '-Wextra-tokens'
make: *** [bcrypt_ext.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/username/.rvm/gems/ruby-2.1.4@my_app/gems/bcrypt-3.1.10 for inspection.
Results logged to /Users/username/.rvm/gems/ruby-2.1.4@my_app/extensions/x86_64-darwin-14/2.1.0/bcrypt-3.1.10/gem_make.out
An error occurred while installing bcrypt (3.1.10), and Bundler cannot continue.
Make sure that `gem install bcrypt -v '3.1.10'` succeeds before bundling.

我使用gcc安装了homebrew并尝试了版本4.9.3和5.2

我当前的gcc --version

gcc (Homebrew gcc49 4.9.3) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

为什么gcc无法处理这些命令行选项?

1 个答案:

答案 0 :(得分:0)

发现问题。

application.properties导致/usr/local/bin/gcc无效。

所以我删除了符号链接并创建了一个链接到/usr/local/Cellar/gcc49/4.9.3/bin/gcc-4.9的新符号,这解决了问题:)