Gem installation error: You have to install development tools first Gem installation error: You have to install development tools first windows windows

Gem installation error: You have to install development tools first


This worked for me:

sudo xcode-select -switch /


Have you run:

xcode-select --install

To install the Xcode Developer tools?


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"