我正在尝试安装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
无法处理这些命令行选项?
答案 0 :(得分:0)
发现问题。
application.properties
导致/usr/local/bin/gcc
无效。
所以我删除了符号链接并创建了一个链接到/usr/local/Cellar/gcc49/4.9.3/bin/gcc-4.9
的新符号,这解决了问题:)