GitHub user keypointt opened a pull request:
https://github.com/apache/spark/pull/13308
[SPARK-15542][SparkR] Make error message clear for script
'./R/install-dev.sh' when R is missing on Mac
https://issues.apache.org/jira/browse/SPARK-15542
## What changes were proposed in this pull request?
When running`./R/install-dev.sh`, I got
```
mbp185-xr:spark xin$ ./R/install-dev.sh
usage: dirname path
```
This message is very confusing to me, and then I found R is not properly
configured on my Mac when this script is using `$(which R)` to get R home.
I tried similar situation on CentOS with R missing, and it's giving me very
clear error message while MacOS is not.
on CentOS:
```
[root@ip-xxx-31-9-xx spark]# which R
/usr/bin/which: no R in
(/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/lib/jvm/java-1.7.0-openjdk.x86_64/bin:/root/bin)
```
but on Mac, if not found then nothing returned and this is causing the
confusing message for R build failure and running R/install-dev.sh:
```
mbp185-xr:spark xin$ which R
mbp185-xr:spark xin$
```
Here I just added a clear message for this miss configuration for R when
running `R/install-dev.sh`.
```
mbp185-xr:spark xin$ ./R/install-dev.sh
Cannot find R home by running 'which R', please make sure R is properly
installed.
```
## How was this patch tested?
Manually tested on local machine.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/keypointt/spark SPARK-15542
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/13308.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #13308
----
commit 52ea7ccbf2782ab274913a833a715f4069551cdd
Author: Xin Ren <[email protected]>
Date: 2016-05-25T22:35:19Z
[SPARK-15542] throw message for missing R for R/install-dev.sh
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]