我正在尝试安装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.我安装了带有homebrew的gcc,并尝试了版本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不能处理这些命令行选项?
发布于 2015-07-26 00:14:06
找到了问题所在。
/usr/local/bin/gcc导致了不起作用的/usr/local/Cellar/gcc49/4.9.3/bin/gcc-4.9。
因此,我删除了符号链接,并创建了一个新的链接到/usr/bin/gcc_mavericks,从而解决了问题:)
https://stackoverflow.com/questions/31627944
复制相似问题