Mac installation tmux error C compiler cannot create executables

error message
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
= > Installing dependencies for tmux: pkg-config, makedepend, Libevent
= > Installing tmux dependency: pkg-config
= > Downloading from / Users/yang/Library/Logs/Homebrew/pkg-config/01.configure:
checking for gawk. No
checking for mawk. No
checking for nawk. No
checking for awk. Awk
checking whether make sets $(MAKE). Yes
checking whether make supports nested variables. Yes
checking build system type. X86_64-apple-darwin17.5.0
checking host system type. X86_64-apple-darwin17.5.0
checking how to print strings. Printf
checking for style of include used by make. GNU
checking for gcc. Clang
checking whether the C compiler works. No
configure: error: in `/ private/tmp/pkg-config20180505-48853-1sfwnzj Charpy PKG murconfigAfter 0.29mm:
configure: error: C compiler cannot create executables
See `config.log" for more details
/ System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require": no implicit conversion of nil into String (TypeError)

from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require"
from /usr/local/Library/ENV/4.3/gcc-4.2:4:in `<main>"

READ THIS: https://git.io/brew-troublesh.

/ System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:359:in `open_http": 422 Unprocessable Entity (GitHub::Error)

from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:737:in `buffer_open"
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:212:in `block in open_loop"
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:210:in `catch"
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:210:in `open_loop"
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:151:in `open_uri"
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:717:in `open"
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:31:in `open"
from /usr/local/Library/Homebrew/utils.rb:461:in `open"
from /usr/local/Library/Homebrew/utils.rb:491:in `issues_matching"
from /usr/local/Library/Homebrew/utils.rb:523:in `issues_for_formula"
from /usr/local/Library/Homebrew/exceptions.rb:222:in `fetch_issues"
from /usr/local/Library/Homebrew/exceptions.rb:218:in `issues"
from /usr/local/Library/Homebrew/exceptions.rb:261:in `dump"
from /usr/local/Library/brew.rb:195:in `rescue i
Menu