question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'R path not working: /usr/local/bin/R (Can be changed in setting r.rpath.XXX)'

See original GitHub issue

Description R Debugger doesn’t see the R executable, even though the correct R path has been given?

To Reproduce

  1. Install the prerequisites (R, VSCode, the R extension for VSCode)
  2. Install R Debugger, along with dependencies
  3. Create a new folder, with a simple R file, test.R, with something like below
  4. Try to run said code

Your R code

test.R

print(hello world')
a <- 2 + 2

Your Launch config If applicable, the launch config that causes the bug. E.g.:

        {
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "R-Debugger",
            "name": "Launch R-Workspace",
            "request": "launch",
            "debugMode": "workspace",
            "workingDirectory": "${workspaceFolder}"
        },
        {
            "type": "R-Debugger",
            "name": "Debug R-File",
            "request": "launch",
            "debugMode": "file",
            "workingDirectory": "${workspaceFolder}",
            "file": "${file}"
        },
        {
            "type": "R-Debugger",
            "name": "Debug R-Function",
            "request": "launch",
            "debugMode": "function",
            "workingDirectory": "${workspaceFolder}",
            "file": "${file}",
            "mainFunction": "main",
            "allowGlobalDebugging": false
        },
        {
            "type": "R-Debugger",
            "name": "Debug R-Package",
            "request": "launch",
            "debugMode": "workspace",
            "workingDirectory": "${workspaceFolder}",
            "includePackageScopes": true,
            "loadPackages": [
                "."
            ]
        },
        {
            "type": "R-Debugger",
            "request": "attach",
            "name": "Attach to R process",
            "splitOverwrittenOutput": true
        }
    ]
}

Expected behavior Run

Actual behavior Throws an error

Desktop (please complete the following information):

  • OS: Mac OS 12.0 (M1 based)
  • R Version: R version 4.1.2 (2021-11-01) – “Bird Hippie”
  • vscDebugger Version: vscDebugger_0.4.7
  • vscode-r-debugger Version: v0.4.7

Additional context I’m new to VS Code, coming from RStudio, so I may have messed something up here, however, I’ve tried installing it three times now (reinstalling VSCode, with no luck!). Don’t know what I’m doing wrong.

The path to R is the one in the title, I’ve double checked! I’ve added the path to both the rterm and rpath options in settings, and it doesn’t work, nor does removing both. VS Code can see the R binary for the terminal, but the debugger seemingly cannot see it

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:27 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
PaulKeydelcommented, Jan 24, 2022

The vscDebugger package has been not released on CRAN ever. Please check this thread. ManuelHentschel/vscDebugger#170

You may install the latest version by remotes::install_github("ManuelHentschel/vscDebugger@*release").

Yeah, that was the missing link 😃 So, following @eitsupi and using the current R patches from https://mac.r-project.org/ should finally solve the initial issue!

2reactions
PaulKeydelcommented, Jan 24, 2022

Good and bad news so far: The above issue that R ignores input from stdin when the --interactive flag is set, is still fixed in newer versions of R. You could find these patches (including installer packages) here: https://mac.r-project.org

However, after the installation I got some new problems concerning the R-package “vscDebugger”, which is necessary for debugging. Up to now, this package is not supported by newer R versions. So the installation via install.packages(“vscDebugger”) results in an error:

> install.packages("vscDebugger")
--- Please select a CRAN mirror for use in this session ---
Warning message:
package ‘vscDebugger’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages 

I think we have to wait until the next official version of R is released…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing R for VSCode issues (R LSP) - Stack Overflow
Step 1: Ensure R is setup right: In your JSON settings, change r.rpath.windows and --r-binary from.
Read more >
Configuration • vscDebugger
r.rpath.XXX (string) : The path to the R executable itself (not just the directory!). Can usually be left empty on a windows installation...
Read more >
R Installation and Administration
Choose a place to install the R tree (R is not just a binary, ... The default path for R.framework is /Library/Frameworks but...
Read more >
R Debugger - Visual Studio Marketplace
If your R path is neither in the Windows registry nor the PATH environment variable, make sure to provide a valid path to...
Read more >
R Installation and Administration - sheepsqueezers.com
The default installation path for 'R.framework' is '/Library/Frameworks' but this can be changed at configure time by specifying the flag ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found