优胜美地宝石安装失败

时间:2014-12-09 05:56:04

标签: ruby-on-rails macos gcc gem

升级到yosemite后,我无法运行我的捆绑安装,mkmf.log的内容如下

  

/usr/local/opt/gcc46/bin/gcc-4.6 -o conftest -I/Users/mac/.rvm/rubies/ruby-1.9.3-p547/include/ruby-1.9.1/x86_64-darwin12.4.0 -I/Users/mac/.rvm/rubies/ruby-1.9.3-p547/include/ruby-1.9.1/ruby/backward -I/Users/mac/.rvm/rubies/ruby-1.9.3-p547/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fno-common -pipe conftest.c -L. -L/Users/mac/.rvm/rubies/ruby-1.9.3-p547/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -lruby.1.9.1 -lpthread -ldl -lobjc

似乎它正在尝试使用gcc-4.6但是当我使用gcc -v时它会给我这个

  

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.0.0 Thread model: posix

我还尝试用ln -s链接/usr/local/opt/gcc46/bin/gcc-4.6但是没有帮助,我一直在

  

/Users/mac/.rvm/rubies/ruby-1.9.3-p547/bin/ruby extconf.rb checking if the C compiler accepts ... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

任何帮助都会非常感激

2 个答案:

答案 0 :(得分:0)

尝试重新安装ruby:

rvm get stable
rvm reinstall 1.9.3-p547

然后bundle install

答案 1 :(得分:0)

我遇到了同样的问题 - 事实证明,我必须在最新版本中重新安装红宝石并构建所有宝石原始。

http://danielpuglisi.com/articles/2014/10/reinstall-ruby-after-upgrading-to-osx-yosemite

这个解决方案工作得很好,我删除了rbenv中列出的所有旧版本,然后按照链接中的描述安装了ruby 2.1.3,然后使用了gem pristine --all,我很高兴,没有更烦人的错误消息。

这些步骤实际上取决于您使用的是哪个,rbenv或rmv。