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

R_HOME not found in Docker container #117

Open
yonicd opened this issue Aug 23, 2021 · 4 comments
Open

R_HOME not found in Docker container #117

yonicd opened this issue Aug 23, 2021 · 4 comments

Comments

@yonicd
Copy link

yonicd commented Aug 23, 2021

Thanks for writing this book, it is very enjoyable to read and learn from it.

In chapter 5 where rush is introduced I am trying to run the examples to create figure 5.1 and am getting an error

$rush plot -x value -y count --geom col --height 2 fb.csv > fb.png
ERROR: R_HOME ('/usr/lib/R') not found

after figuring out that {rush} is an R package I tried loading R directly and got the same error

$R
ERROR: R_HOME ('/usr/lib/R') not found
$which R
/usr/bin/R

$/usr/bin/R
ERROR: R_HOME ('/usr/lib/R') not found

I tried adding the path to $PATH, that didnt help either

$ echo $PATH
/usr/lib/R:/usr/local/lib/R/site-library/rush/exec:/usr/bin/dsutils:/home/dst/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Last i tried to reinstall via apt-get R itself, that didnt help either.

Any suggestions on getting past this little problem?

@jeroenjanssens
Copy link
Owner

Thank you for your kind words and for taking the time to report this issue.

I have had one other person report the same issue, but I'm afraid that I'm unable to reproduce this myself. Could you please let me know:

  1. Your OS
  2. The exact command that you used to start the Docker container
  3. The output of "cat /tag" from within the container (this file contains the date on which the container was built)

For myself:

  1. macOS 11.2.3 (on MacBook Pro M1)
  2. docker run -it --rm datasciencetoolbox/dsatcl2e:latest
  3. 20210628

Thank you,

Jeroen

@yonicd
Copy link
Author

yonicd commented Sep 6, 2021

  1. MacOS 11.4 (MacBook Pro)
  2. docker run --rm -it -v "$(pwd)":/data datasciencetoolbox/dsatcl2e (from book instructions setup)
  3. 20210628

FWIW I tried this on a WinOS 10 w WSL 2 and got the same error msg.

@jeroenjanssens jeroenjanssens changed the title r_home not found in docker containter R_HOME not found in Docker container Sep 7, 2021
@jeroenjanssens
Copy link
Owner

Thank you. I also tested it on an older MacBook (not M1) and on Windows. Both cases worked. Very curious.

I found this answer on Stack Overflow. Would you mind running the following in the Docker container:

$ export R_HOME=/usr/lib/R
$ R

I have no idea if this works, but if it does, then I'll change the Docker image to set this variable. Thanks for your help.

@yonicd
Copy link
Author

yonicd commented Sep 7, 2021

I have tried this in the past (added to the PATH in original post), it doesn't seem to work.

$ export R_HOME=/usr/lib/R                                                                         
$ R
ERROR: R_HOME ('/usr/lib/R') not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants