R 3.3.3环境下VGAM旧版本安装失败求助
Looks like you're hitting a classic compiler dependency issue with old R versions on macOS Mavericks—let's break this down step by step to get VGAM installed properly.
1. What is gfortran, and why do you need it?
gfortran is the GNU Fortran compiler. Many R packages (including VGAM) have low-level code written in Fortran for better performance, so you need this compiler to build the package from source. Your error make: gfortran-4.8: No such file or directory means your system can't find the exact gfortran version VGAM 1.0-2 expects.
2. Install the right gfortran version for Mac OS 10.9.5
Since you're on Mavericks (10.9.5), you need gfortran 4.8.2—this is the compatible version for your OS:
- Download the gfortran 4.8.2 installer made for Mac OS X 10.9 (you can find this on CRAN's tools page for legacy macOS versions).
- Run the installer, then verify it's working by opening Terminal and typing:
You should see output confirming version 4.8.2 is installed.gfortran --version
3. Re-run the correct source package installation
Your first method is the right way to install an old source package—now that you have gfortran, try this again in R:
install.packages('VGAM_1.0-2.tar.gz', lib = "/Users/benny/Google Drive/SEDGWICK PROJECT GRANIVORES/R", repos = NULL, dependencies = TRUE)
If you hit dependency errors first, manually install the packages VGAM 1.0-2 depends on (check the legacy CRAN page for VGAM 1.0-2 to see the full dependency list, then install those first with install.packages()).
4. Why your other two methods won't work
Let's be clear: .RData files are R workspace/dataset files—they are not R packages. Unpacking the source tarball and loading this file only loads temporary data from the package's development process, not the actual package functions or code. These methods will never let you use VGAM, so you can safely discard them.
Extra troubleshooting steps
If you still get errors after installing gfortran:
- Make sure you have Xcode Command Line Tools installed for Mavericks. Open Terminal and run:
If that doesn't work, you may need to download the legacy Command Line Tools for Xcode 6.2 (compatible with 10.9) from Apple's developer archive.xcode-select --install - Verify R is pointing to the right gfortran binary. In R, run:
If it doesn't returnSys.getenv("FC")/usr/local/bin/gfortran-4.8, set it manually before installing:Sys.setenv(FC = "/usr/local/bin/gfortran-4.8")
内容的提问来源于stack exchange,提问作者benny_noJets

