MacOS Installing BayesFactor package and dependencies via gfortran as compiler

My ultimate goal is to install the package, BayesFactor. To install it and its dependencies required 'gfortran' to compile when necessary. I have MacOS and am trying to set the 'gfortran' path in R. I verified that the location of gfortran is "/usr/local/bin/gfortran". However, the following code does not seem to work to install any dependencies (see code and output below). Is this error occuring because R cannot find the compiler, 'gfortran'? If so, what should I do instead?

Sys.setenv(PATH = paste("/usr/local/bin/gfortran", Sys.getenv("PATH"), sep = ":"))
install.packages("~/Downloads/BayesFactor_0.9.12-4.4 (2).tar.gz", repos = NULL, type = "source")
ERROR: dependency ‘hypergeo’ is not available for package ‘BayesFactor’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/BayesFactor’
    Warning in install.packages :
    installation of package ‘/Users/AsuS/Downloads/BayesFactor_0.9.12-4.4 (2).tar.gz’ had non-zero exit status