title: Failed to build gem native extension when installing OpenSSL
body: <p>So I am following this tutorial: <a href="https://meta.discourse.org/t/beginners-guide-to-install-discourse-on-macos-for-development/15772" rel="nofollow noreferrer">https://meta.discourse.org/t/beginners-guide-to-install-discourse-on-macos-for-development/15772</a> but when I use <code>bundle install</code> it gives me this error:</p>
  <pre><code>An error occurred while installing openssl (2.2.0), and Bundler cannot
  continue.
  Make sure that `gem install openssl -v '2.2.0' --source 'https://rubygems.org/'`
  succeeds before bundling.
  </code></pre>
  <p>along with</p>
  <pre><code>Installing openssl 2.2.0 with native extensions
  Installing cppjieba_rb 0.3.3 with native extensions
  Gem::Ext::BuildError: ERROR: Failed to build gem native extension
  </code></pre>
  <p>but why do I get this?</p>
  <p>Running <code>gem install openssl -v '2.2.0' --source 'https://rubygems.org/'</code> gives me...</p>
  <pre><code>Building native extensions. This could take a while...
  ERROR:  Error installing openssl:
      ERROR: Failed to build gem native extension.
  
      current directory: /Library/Ruby/Gems/2.6.0/gems/openssl-2.2.0/ext/openssl
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20210225-70291-10x2bpm.rb extconf.rb
  checking for t_open() in -lnsl... no
  checking for socket() in -lsocket... no
  checking for openssl/ssl.h... no
  *** extconf.rb failed ***
  Could not create Makefile due to some reason, probably lack of necessary
  libraries and/or headers.  Check the mkmf.log file for more details.  You may
  need configuration options.
  
  Provided configuration options:
      --with-opt-dir
      --without-opt-dir
      --with-opt-include
      --without-opt-include=${opt-dir}/include
      --with-opt-lib
      --without-opt-lib=${opt-dir}/lib
      --with-make-prog
      --without-make-prog
      --srcdir=.
      --curdir
      --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
      --with-openssl-dir
      --with-openssl-include
      --without-openssl-include=${openssl-dir}/include
      --with-openssl-lib
      --without-openssl-lib=${openssl-dir}/lib
      --with-kerberos-dir
      --without-kerberos-dir
      --with-kerberos-include
      --without-kerberos-include=${kerberos-dir}/include
      --with-kerberos-lib
      --without-kerberos-lib=${kerberos-dir}/lib
      --with-debug
      --without-debug
      --enable-debug
      --disable-debug
      --with-nsllib
      --without-nsllib
      --with-socketlib
      --without-socketlib
      --with-openssl-config
      --without-openssl-config
      --with-pkg-config
      --without-pkg-config
  extconf.rb:99:in `&lt;main&gt;': OpenSSL library could not be found. You might want to use --with-openssl-dir=&lt;dir&gt; option to specify the prefix where OpenSSL is installed. (RuntimeError)
  
  To see why this extension failed to compile, please check the mkmf.log which can be found here:
  
    /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/openssl-2.2.0/mkmf.log
  
  extconf failed, exit code 1
  
  Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/openssl-2.2.0 for inspection.
  Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/openssl-2.2.0/gem_make.out
  </code></pre>
  <p>Again, why does this happen? Please help!
  ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀</p>