Gem installation error: You have to install development tools first
I was having this issue on MacOS Mojave(10.14.1). Installing latest ruby via Homebrew and setting some env variables solved it for me:
(copied from brew info ruby
instructions)
export PATH="/usr/local/opt/ruby/bin:$PATH"export LDFLAGS="-L/usr/local/opt/ruby/lib"export CPPFLAGS="-I/usr/local/opt/ruby/include"export PKG_CONFIG_PATH="/usr/local/opt/ruby/lib/pkgconfig"