Couldn't run gem commands in terminal

I have installed ruby version 2.7.5 as in the gem file but when installing for Jekyll bundler it is giving a load error

1 Like

@Sudhanshu_Dasgupta good of you to raise this question. Will you copy and paste your terminal output here?

sure @Lee
sudhanshutech@LAPTOP-KEVP12FC:~$ gem update
ERROR: Loading command: update (LoadError)
cannot load such file – openssl
ERROR: While executing gem … (NoMethodError)
undefined method `invoke_with_build_args’ for nil:NilClass

sudhanshutech@LAPTOP-KEVP12FC:~ $ gem install jekyll bundler
ERROR: Loading command: install (LoadError)
cannot load such file – openssl
ERROR: While executing gem … (NoMethodError)

Be sure to install openssl (brew install openssl depending upon your OS type).

I have openssl installed but I am still facing the same problem. Any fixes?

anandtheertha@anandtheertha-Aspire-F5-573G:/home$ openssl version
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)
anandtheertha@anandtheertha-Aspire-F5-573G:/home$ gem update
ERROR: Loading command: update (LoadError)
cannot load such file – openssl
ERROR: While executing gem … (NoMethodError)
undefined method `invoke_with_build_args’ for nil:NilClass

This helped me fix OpenSSL issues in Ubuntu22.04

rvm pkg install openssl
rvm reinstall ruby-2.7.5 --with-openssl-dir=$rvm_path/usr
2 Likes

Me, too. The --with-openssl-dir= being key here.

1 Like

For those running into openssl issues when installing Ruby 3.2.2, here’s what worked for me:

rvm install 3.2.2 --enable-shared --with-openssl-dir=/usr/local/opt/openssl@1.1