You might have the latest RStudio version but you have an old R version. RStudio is an IDE for the R programming language but they have independent versions.
Precompiled binaries of the latest package versions are only available for the latest R version, when you use an old R version you are forced to compile from source, but you are missing the required compilers in your system. You can either update your R version to get access to precompiled binaries or install the recommended development tools for macOS systems.
https://mac.r-project.org/tools/