Hi there, thank you for building the package.
I am trying to use beautify for R code. I am using Windows 10 OS. I am running into the bellow error message. I do have formatR package installed. Any help is greatly appreciated. Thanks again
Error: Could not find 'Rscript'. The program may not be installed.
at R.module.exports.Beautifier.commandNotFoundError (file:///C:/Users/ku906/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:204:14)
at file:///C:/Users/ku906/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee:304:22
at tryCatcher (C:\Users\ku906.atom\packages\atom-beautify\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\Users\ku906.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:510:31)
at Promise._settlePromise (C:\Users\ku906.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:567:18)
at Promise._settlePromise0 (C:\Users\ku906.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:612:10)
at Promise._settlePromises (C:\Users\ku906.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:687:18)
at Async._drainQueue (C:\Users\ku906.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:138:16)
at Async._drainQueues (C:\Users\ku906.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:148:10)
at Async.drainQueues (C:\Users\ku906.atom\packages\atom-beautify\node_modules\bluebird\js\release\async.js:17:14)
at process._tickCallback (internal/process/next_tick.js:103:7)
The formatR beautifier requires Rscript which I believe is installed with R itself.
Be sure R is installed ( https://www.r-project.org/ ) and also that your PATH environment variable is setup properly so Atom-Beautify can use it.
Here is the applicable PR: https://github.com/Glavin001/atom-beautify/pull/1128
Maybe @Sebastian-D could help out.
@srivathsesh : If you are unable to get it to work then please include your debug.md Gist. See https://github.com/Glavin001/atom-beautify/blob/master/docs/troubleshooting.md for details.
@Glavin001, Thank you for your quick response. I am sure I am not doing something right here. Here is the link to debug.md.
https://gist.github.com/anonymous/0545c87ed6a7deadefe4ebf691a2dc32
I agree that it seems to be a problem with Rscript. It is not tested for windows so I do not know exactly what you need to make it work. Basically it executes the command Rscript formatR.r <indent_size> your_file > your_file, thus replacing your file with the beautified version.
See file atom-beautify/src/beautifiers/formatR/index.coffee
Either make it so this command works in windows or I suppose change it so it runs one command for windows and one command for other. Rscript should work in windows, see for example: http://stackoverflow.com/questions/5720317/running-r-from-windows-command-prompt
@Glavin001 does some other language have "if windows; do this" type of behaviour?
Edit: I just checked a coworkers computer and within her R installation (bin folder) there is Rscript.exe, however she had to point directly to that file for it to work. For example "C:her/R/bin/Rscript.exe" formatR.r <indent_size> your_file > your_file. If you create a alias or somehow make it understand just "Rscript" as "C:her/R/bin/Rscript.exe" it might work.
I just checked a coworkers computer and within her R installation (bin folder) there is Rscript.exe, however she had to point directly to that file for it to work.
The PATH environment variable should contain C:her/R/bin/ such that Windows can find Rscript.exe. I think https://www.java.com/en/download/help/path.xml may be useful for Windows users.
@srivathsesh I encourage you to do the same. Test from your command-line both directly calling Rscript with absolute path and then with only Rscript.
This is a personal setup issue and likely not an Atom-Beautify issue.
Thank you so much. You folks are awesome. I'll try it tonight.
Sent from my iPhone
On Oct 3, 2016, at 9:48 AM, Glavin Wiechert [email protected] wrote:
I just checked a coworkers computer and within her R installation (bin folder) there is Rscript.exe, however she had to point directly to that file for it to work.
The PATH environment variable should contain C:her/R/bin/ such that Windows can find Rscript.exe. I think https://www.java.com/en/download/help/path.xml may be useful for Windows users.
@srivathsesh I encourage you to do the same. Test from your command-line both directly calling Rscript with absolute path and then with only Rscript.This is a personal setup issue and likely not an Atom-Beautify issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
I really want to focus on improving the installation experience for users. I have created a new Issue, #1687, to target this problem. Please provide your feedback! Thanks in advance.
