Gem::Ext::BuildError: ERROR: Failed to build gem native extension for Puma Gem

You need homebrew and openssl. Run brew install openssl and then bundle config build.puma --with-opt-dir=/usr/local/opt/openssl

Then running bundle install should work.

Relevant issue: https://github.com/puma/puma/issues/718


If you are using ubuntu 14.04 to any upgraded versions and if you have installed OpenSSL in your system then you just need to run these commands

First Just get the location where OpenSSL installed normally it is installed in this location /usr/bin/openssl if you have installed in separate location get your location first using

 sudo find / -name openssl

and then

bundle config build.puma --with-opt-dir=/usr/bin/openssl

and then

bundle install 

It will be succeeded unless your OpenSSL installed in a path is correct

If you haven't installed OpenSSL before just install it using

sudo apt-get install openssl

It will work prefectly. Cheers