Run `brew --prefix openssl` to figure out where your openssl is installed and use the directory. Mine was installed in /opt/homebrew/opt/openssl because I reconfigured my homebrew to work with Mac M1.
I had the same problem when installing the Jekyll gem today. I found your video, added the flag at the end, and it worked! Thank you 😀 It might be worthwhile noting that everything from you solution after the gem name must be added: "-- --with-cppflags=-I/usr/local/opt/openssl/include". The first two dashes and the dash after the equal sign tripped me up the first time 😀