R is unable to locate openssh on my system

Howdy! I'm trying to install tidyverse and it's getting hung up on openssl. I have reinstalled openssl@1.1 via homebrew (mac OS), added export PATH="/usr/local/opt/openssl/bin:$PATH" to .zshrc, have restarted RStudio, but still keep getting this error:

Configuration failed because openssl was not found. Try installing:
 * deb: libssl-dev (Debian, Ubuntu, etc)
 * rpm: openssl-devel (Fedora, CentOS, RHEL)
 * csw: libssl_dev (Solaris)
 * brew: openssl@1.1 (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
tools/version.c:1:10: fatal error: 'openssl/opensslv.h' file not found

I'm not sure what pkg-config refers to or where to manually set the INCLUDE_DIR and LIB_DIR. Has anyone run into an issue like this before?

On further inspection, RStudio seems to be looking at a completely different PATH to what I see in terminal. Apparently since I launch Rstudio from the dock, it doesn't get access to the .zsh environment variables. How can I rectify this? This has never been a problem before - about to try uninstalling everything and starting again (to be honest, the "uninstallation" process of anything on Mac OS has always been a bit dubious to me, but I'll give it a go)

sudo cp /usr/local/opt/openssl@1.1/lib/pkgconfig/*.pc /usr/local/lib/pkgconfig/ seems to have solved the issue. Would still love to know why the PATH doesn't match up though!

Yes, there's no shell involved when launching RStudio from the dock so your shell init scripts won't work there. There's a pretty good Stack Overflow entry describing your various options for setting environment variables (like PATH) for macOS apps launched from the dock: macos - Setting environment variables on OS X - Stack Overflow

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.