Error when installing ggplot2, need c compiler - r

I'm trying to install ggplot2 on a collaborator's Mac computer. I get this error:
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
ERROR: configuration failed for package ‘stringi’
It looks like I need to install a C compiler. After searching around, the only thing I see mentioned is gcc. To install this, I need to install XCode from the App store. When I try to install XCode, I get a message saying that Mac OS 10.10 or higher is required. His machine is 10.7.5, so it won't intstall.
Is there any way that I can install gcc?

Related

Initial Rattle issues (Os) "Error: -with-x11" & "Error: gtk+ 2.24.32 did not build"

I have been trying to install Rattle on my Os into my R using this instructions:
https://zhiyzuo.github.io/installation-rattle/
I get to Line 7 and input
~$ brew install --with-x11 cairo
and then get
Updating Homebrew...
Usage: brew install [options] formula|cask
Install a formula or cask. Additional options specific to a formula may be
appended to the command.
Unless HOMEBREW_NO_INSTALL_CLEANUP is set, brew cleanup will then be run for
the installed formulae or, every 30 days, for all formulae.
...
**Error: invalid option: --with-x11**'''
Ive tried to continue on installing Cairo without the "--with-x11" (as been suggested they no longer support that).
So I did just "brew install cairo" that worked.
I go to line 9 Now we can install gtk+ by:
~$ brew install --build-from-source --verbose gtk+
And I get:
**Error: gtk+ 2.24.32 did not build
Logs:
/Library/Logs/Homebrew/gtk+/00.options.out
/Library/Logs/Homebrew/gtk+/01.configure.cc
/Library/Logs/Homebrew/gtk+/config.log
/Library/Logs/Homebrew/gtk+/01.configure
READ THIS: https://docs.brew.sh/Troubleshooting'''
If this helps in the last part I see in the terminal things saying:
==> ./configure --disable-dependency-tracking --disable-silent-rules - -prefix=/usr/local/Cellar/gtk+/2.24.32_3 --disable-glibtest --enable-introspection=yes --with-gdktarget=x11 --enable-x11-backend
configure: WARNING: unrecognized options: --enable-x11-backend
and
configure: error: Package requirements (cairo-xlib >= 1.6) were not met:
No package 'cairo-xlib' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables CAIRO_BACKEND_CFLAGS
and CAIRO_BACKEND_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
Anyone have any suggestions for this ?
Thanks.

RStudio error: unable to find utility "package", not a developer tool or in PATH

Issue description:
I'm trying to install 'ggplot2' package on my R studio I'm installing on MacOs Mojave 10.14.1. Each time I'm trying to installing using either
install.packages("ggplot2", dependencies = T)
R Studio -> tools -> install packages... and type down 'ggplot2'
I have the following error appear:
sh: line 1: 1549 Abort trap: 6 /Applications/Xcode.app/Contents/Developer
error: unable to find utility "package_name", not a developer tool or in PATH
My approach to solve the issue:
I made sure that Xcode installed and updated
in R Studio, I made sure that I'm able to download contents without using secure HTTPS method
tools -> global options -> packages -> unchecked 'Use secure download method for HTTP '
none of above approaches worked for me.
How can I overcome this issue ?!
I come across the solution in Stackoverflow provided by Ivan Mir, basically you need do the following:
Check out xcode-select --print-path in your Terminal.
If it's /Applications/Xcode.app/Contents/Developer then run
sudo xcode-select --switch /Library/Developer/CommandLineTools to set xcode-select to non-Xcode Command Line Tools.
In case you don't have /Library/Developer/CommandLineTools directory, you can get them here for your current Xcode version.

R - XLConnectJars install fails because rJava is not installed correctly

I am trying to install XLConnectJars to R and I keep getting the following error despite having Java DK and rJava installed?
Error: Package as namespace load failed for 'XLConnectJars'
.onLoad failed om LoadNamespace() for 'rJava', details:
call: library.dynam("rJava",pkgname,libname)
error: DLL 'rJava' not found: maybe not installed for this architecture?
Any help greatly appreciated!
XLConnectJars is a support package used by XLConnect, a platform-independent interface to Microsoft Excel. In order for XLConnectJars to install correctly, one must also install the rJava package.
The error noted in the OP indicates that rJava did not install correctly.
error: DLL 'rJava' not found: maybe not installed for this architecture?
Many people encounter problems installing rJava because it cannot access the Java Runtime from the operating system. Solutions to the "unable to access Java runtime" problem vary by operating system.
Windows
People often have 32-bit Java installed and then use 64-bit R. The 64-bit version of R requires the 64-bit version of Java.
Solution: Install the 64-bit version of the Java Runtime for Windows from the Java Download web page.
MacOS
Details to configure rJava on MacOS are covered in another SO answer I posted, Unable to load rJava in RStudio, which I am reposting here for convenience.
There is a very specific sequence of steps that must be taken to get rJava to work on a Macbook, as documented in rJava Issues #86.
Download and install Java from Oracle
Uninstall any previously installed version of rJava
Add JAVA_HOME to your .bashrc
Close & restart terminal, R and RStudio sessions so they pick up the updated JAVA_HOME
Use install.packages() to install rJava
See the URL link above for additional details on each step.
Ubuntu Linux
Use the Advanced Packaging Tool to install Java, then reconfigure Java support in R.
sudo apt-get install openjdk-8-jdk # openjdk-9-jdk has some installation issues
sudo R CMD javareconf
Once these steps are completed, install the XLConnectJars package with install.packages("XLConnectJars").
NOTE: some of this content is adapted from an article I previously posted on my Github site, Common Problems with Java and the xlsx Package.

Trouble installing and loading "mlrMBO" package in R

So when I install the package, R returns the following error message:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘mlrMBO’
But It then says the package has non-zero exit status and is in
‘/private/var/folders/b_/xwf1w6cn769_2gq06fntysxm0000gn/T/RtmpCGAr62/downloaded_packages’
When I load the package
library(mlrMBO)
It says the package doesn't exist.
I've tried many different methods like using this code
install.packages('mlr', repo='http://cran.fiocruz.br/')
Here's a couple of things you could try:
Make sure you don't have any Umlauts (ö,ä,ü, å) in your path, i.e. your User-folder, if you're running on windows.
Install devtools install.package("devtools)
clear data in \AppData\Local\Temp\
That package requires compiling C code, for which you have to install the Xcode developer tools.
Per Housemd's answer at Apple.SE:
Open Terminal, and run the following:
xcode-select --install
This will download and install xcode developer tools and fix the problem. The problem is that one needs to explicitly agree to the license agreement.
I found the solution in this question, Command Line Tools not working.
Once you've done that, run install.packages again.

'curl_version_info_data' has no member named 'libssh_version'

I need to install plotly package for R(3.3.1) in a Redhat server 5.11. It requires curl to be installed first. I downloaded the package from https://cran.r-project.org/web/packages/curl/index.html.
When I try to install the package, it gives below error:
version.c: In function 'R_curl_version':
version.c:15: error: 'curl_version_info_data' has no member named 'libssh_version'
version.c:15: error: 'curl_version_info_data' has no member named 'libssh_version'
make: *** [version.o] Error 1
ERROR: compilation failed for package 'curl'
Has anyone had the same issue before?
Thanks in advance for any suggestion.
You need to install the development version of the curl library before installing the package. Try yum install curl-devel.
One note though - whenever you run into a similar error it is typically because a development version of a library is not installed on your redhat system.
Thanks Jim for your reply.
I found the solution is to use a lower version curl package which has not included the definition for "libssh_version" in the file version.c, e.g. curl_0.9.6.tar.gz with the command:
sudo R CMD INSTALL curl_0.9.6.tar.gz
I've also tried "yum install curl-devel", but it shows the message:
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Install Process
Package curl-devel-7.15.5-17.el5_9.x86_64 already installed and latest version
Package curl-devel-7.15.5-17.el5_9.i386 already installed and latest version
Nothing to do

Resources