Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release function error #379

Closed
sckott opened this issue Nov 20, 2013 · 7 comments
Closed

release function error #379

sckott opened this issue Nov 20, 2013 · 7 comments

Comments

@sckott
Copy link

sckott commented Nov 20, 2013

release is giving errors on my machine since I updated my OSX os to Mavericks, e.g,

release(pkgname)
...
Checking pkgname with devtools
Checking for any extra files in built .tar.gz file... sh: /usr/bin/gnutar: No such file or directory
Error in system(cmd, intern = TRUE) : error in running command

This error doesn't happen with R CMD CHECK or R CMD BUILD

My setup:
-OSX 10.9
-R 3.0.2

On twitter you asked if I was using the latest version of R, does that mean dev or stable?
I do have the latest devtools from Github, master branch.

@sckott
Copy link
Author

sckott commented Nov 20, 2013

symlinking worked for me (reference: http://apple.stackexchange.com/questions/106189/missing-usr-bin-gnutar-on-mavericks-macports/106209#106209)

sudo ln -s /usr/bin/tar /usr/bin/gnutar

@hadley
Copy link
Member

hadley commented Nov 20, 2013

Closing for now, since I don't think this is a devtools problem.

@hadley hadley closed this as completed Nov 20, 2013
@ncarchedi
Copy link
Contributor

I was having the same issue, but with check():

Checking for any extra files in built .tar.gz file... sh: /usr/bin/gnutar: No such file or directory
Error in system(cmd, intern = TRUE) : error in running command

It looks like Apple got rid of /usr/bin/gnutar in OS X 10.9 (Mavericks).

This solved the problem and now check() passes with no error: http://day-to-day-stuff.blogspot.com/2013/11/installing-gnutar-on-maverick.html

I'm on OS X 10.9.1 with R 3.0.2 and devtools 1.4.1.99.

@GISDev01
Copy link

GISDev01 commented Aug 24, 2016

For any future google'ers that end up here like I did, I actually had a similar issue with using devtools to install xml2 via the git repo.

This is the command and the error I was getting on Ubuntu 14.04.5 on an AWS EC2 box running Anaconda r-essentials as the R 3.2.2 distro:
devtools::install_git("git://github.com/hadley/xml2.git", branch = "master")
Installing xml2
trying URL http://cran.rstudio.com/src/contrib/BH_1.60.0-2.tar.gz
Content type application/x-gzip length 9783419 bytes (9.3 MB)
downloaded 9.3 MB
sh: 1: /bin/gtar: not found

To fix it, I tried something similar to work worked for @sckott above:
sudo ln -s /bin/tar /bin/gtar
Sure enough, symlinking gtar to the real tar did the trick, and the install went perfectly after that.

Pretty sure this has nothing to do with any bugs in devtools or xml2, but something that is wacky with my PATH and Anaconda R having something up with it, but this did the trick for us.

@ressy
Copy link

ressy commented Jun 20, 2017

Just to add a little more proof to what @GISDev01 mentioned (since I'm one of those future googlers), it's Sys.getenv("TAR") by way of utils::untar that's to blame, at least in my case. That getenv call returns /bin/gtar on my system for some reason. (This is all inside an Anaconda-provided R install; it returns the correct path when using the OS-provided R package.)

A simple fix that did the trick for me and doesn't require root access was just doing an export TAR=/bin/tar on the shell before launching R. Then Sys.getenv("TAR") just returns the actual environment variable instead of doing whatever magic it does to try to figure it out, and devtools can untar its dependencies during installation.

@carbocation
Copy link

To make this even simpler for people with this issue, calling the following in R resolved this issue for me without having to exit R, change my path, sudo, etc:

Sys.setenv(TAR = "/bin/tar")

@lock
Copy link

lock bot commented Feb 24, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Feb 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants