Rstan installation on RHEL 6

Thanks!! I have gone through
Home · stan-dev/rstan Wiki · GitHub and have the g++ version as 4.9

g++ --version
g++ (GCC) 4.9.2 20150212

After this I ran the following in R console and received the same error:

>dotR ← file.path(Sys.getenv(“HOME”), “.R”)
if (!file.exists(dotR)) dir.create(dotR)
M ← file.path(dotR, ifelse(.Platform$OS.type == “windows”, “Makevars.win”, “Makevars”))
if (!file.exists(M)) file.create(M)
cat(“\nCXX14FLAGS=-O3 -march=native -mtune=native”,
if( grepl(“^darwin”, R.version$os)) “CXX14FLAGS += -arch x86_64 -ftemplate-depth-256” else
if (.Platform$OS.type == “windows”) “CXX11FLAGS=-O3 -march=native -mtune=native” else
“CXX14FLAGS += -fPIC”,
file = M, sep = “\n”, append = TRUE)> > > > + + + +
>install.packages(“rstan”, repos = “https://cloud.r-project.org/”, dependencies = TRUE)

Error:
Error in .shlib_internal(args) :
C++14 standard requested but CXX14 is not defined