0

I am unable to run my bundle install after I upgraded to yosemite, the contents of mkmf.log are as follows

/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

and it seems like it is trying to use gcc-4.6 but when I do gcc -v it gives me this

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

I also tried doing a ln -s to link /usr/local/opt/gcc46/bin/gcc-4.6 but it was no help, I keep getting

/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..

Any help would be really appreciated

Rndm
  • 6,710
  • 7
  • 39
  • 58
Subash
  • 3,128
  • 6
  • 30
  • 44

2 Answers2

0

try reinstall ruby with:

rvm get stable
rvm reinstall 1.9.3-p547

then bundle install

Pavel Evstigneev
  • 4,918
  • 31
  • 21
  • got this while doing that `checking whether the C compiler works... no` `configure: error: in `/Users/mac/.rvm/src/ruby-1.9.3-p547':` `configure: error: C compiler cannot create executables` – Subash Dec 09 '14 at 06:26
  • I guess I'm using both because I have installed xcode and I also downloaded and installed command line tools from apple – Subash Dec 09 '14 at 06:29
  • May be any of this will help http://superuser.com/questions/759363/upgraded-to-mavericks-c-compiler-cannot-create-executables http://stackoverflow.com/questions/19594719/install-any-version-of-ruby-with-rvm-on-mavericks – Pavel Evstigneev Dec 09 '14 at 06:33
  • Did you try `xcode-select --install` ? If it doesn't help then I don't know how to fix it – Pavel Evstigneev Dec 09 '14 at 06:59
  • yes I did and it did not help after installing, thanks for your help though – Subash Dec 09 '14 at 07:04
0

I had the same problem - turns out, I had to reinstall ruby in the newest version and build all gems pristine.

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

This solution worked perfectly, I removed all old versions that were listed in rbenv, then installed ruby 2.1.3 as described in the link, then used gem pristine --all, and I was good to go, no more annoying error messages.

The steps really depends on which one you are using, rbenv or rmv.

tuexss
  • 219
  • 2
  • 11