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

Could not find RScript #1239

Closed
srivathsesh opened this issue Oct 2, 2016 · 7 comments
Closed

Could not find RScript #1239

srivathsesh opened this issue Oct 2, 2016 · 7 comments
Assignees
Milestone

Comments

@srivathsesh
Copy link

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)

@Glavin001
Copy link
Owner

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: #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.

@srivathsesh
Copy link
Author

@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

@Sebastian-D
Copy link
Contributor

Sebastian-D commented Oct 3, 2016

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.

@Glavin001
Copy link
Owner

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.

@Glavin001 Glavin001 self-assigned this Oct 3, 2016
@Glavin001 Glavin001 added this to the v0.30.0 milestone Oct 3, 2016
@srivathsesh
Copy link
Author

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 notifications@github.com 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.

@Glavin001
Copy link
Owner

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.

@Glavin001
Copy link
Owner

#1687 has been published to v0.30.0. You should now be able to configure the executable/script path in Atom-Beautify package settings:
image

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

No branches or pull requests

3 participants