Brew Install Ruby-Build fails with: cannot run C compiled programs

2.1k views Asked by At

i'm trying to install ruby using Homebrew, but every time i try I get this:

==> Installing dependencies for ruby-build: pkg-config, makedepend, opens
==> Installing ruby-build dependency: pkg-config
==> Downloading http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
Already downloaded: /Library/Caches/Homebrew/pkg-config-0.28.tar.gz
==> ./configure --prefix=/usr/local/Cellar/pkg-config/0.28 --disable-host-tool -
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/private/tmp/pkg-config20150616-3766-1f5xqh9/pkg-config-0.28':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

What should I do?

2

There are 2 answers

0
Kingiol On BEST ANSWER

if you install xcode-beta,you should run commond like this:

sudo xcode-select -switch /Applications/Xcode-beta.app/Contents/Developer

0
Badr Yousfi On

Try running this command : xcode-select --install. it works for me