# Struggling to run ruby with openssl newbie please help

**URL:** <https://www.ruby-forum.com/t/struggling-to-run-ruby-with-openssl-newbie-please-help/262097>\
**Category:** Uncategorized\
**Created:** [November 16, 2021, 4:29am UTC](https://www.ruby-forum.com/t/struggling-to-run-ruby-with-openssl-newbie-please-help/262097 "2021-11-16T04:29:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rwidjen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b9bd4f/32.png) [@rwidjen](https://www.ruby-forum.com/u/rwidjen)\
**Post date:** [November 16, 2021, 4:29am UTC](https://www.ruby-forum.com/t/struggling-to-run-ruby-with-openssl-newbie-please-help/262097/1 "2021-11-16T04:29:35Z")

</div>

I need to have a gemfile which has openssl dependency and so I first installed openssl (I tried both ways, using sudo apt-get install openssl and also unzipping downloaded tar files). After that, I did sudo bundle config build.openssl --with-openssl-dir=/usr/local/openssl and then bundle install but it gives me a bunch of errors saying – checking for t\_open() in -lnsl…no checking for socket() in -lsocket…no and a host of other similar stuff. Also something like openssl\_missing.c: error : invalid application of sizeof to incomplete type ‘HMAC\_CTX’ … (Sorry I cannot post the exact screenshot because its on my work PC). I tried with Openssl 1.1.1 as well as 3.0.0 but nothing works. I also tried doing rvm install pkg openssl and tried rebuilding ruby with openssl path as $HOME/.rvm/usr but it gave me errors saying I should recompile with fPIC and exited. Any help is much appreciated.
