Skip to content

RSTUDIO_QUARTO sometimes gets ignored #14090

Open

Description

@ronblum

System details

RStudio Edition : Desktop
RStudio Version : 2022.07.2+576 and 2023.12.0+369
OS Version      : MacOS 14 and Windows 11
R Version       : 4.3.2

Steps to reproduce the problem

Set the variable RSTUDIO_QUARTO in .Renviron to point to a version of Quarto that isn't in PATH nor bundled with the RStudio instance being used.

Describe the problem in detail

In some case, RSTUDIO_QUARTO is ignored.

On one Mac:

# this works
RSTUDIO_QUARTO=/Users/sharon/Documents/quarto/quarto-1.4.534-macos/bin/quarto

# this doesn't work
RSTUDIO_QUARTO=/Users/sharon/Desktop/quarto/quarto-1.4.534-macos/bin/quarto

On another Mac:

# This works
> Sys.getenv("RSTUDIO_QUARTO")
[1] "/Applications/RStudio_Previous/RStudio-2022.07.2-576.app/Contents/MacOS/quarto/bin/quarto"
> quarto::quarto_path()
[1] "/Applications/RStudio_Previous/RStudio-2022.07.2-576.app/Contents/MacOS/quarto/bin/quarto"
> quarto::quarto_version()
[1] '1.1.189'

# This works
> Sys.getenv("RSTUDIO_QUARTO")
[1] "/Users/ronblum/Desktop/quarto/bin/quarto"
> quarto::quarto_path()
[1] "/Users/ronblum/Desktop/quarto/bin/quarto"
> quarto::quarto_version()
[1] '1.2.475'

# This doesn't work
> Sys.getenv("RSTUDIO_QUARTO")
[1] "/Users/ronblum/Applications/quarto/bin/quarto"
> quarto::quarto_path()
[1] "/Applications/quarto/bin/quarto"
> quarto::quarto_version()
[1] '1.4.534'

Describe the behavior you expected

RSTUDIO_QUARTO should always take precedence over whatever's in PATH or bundled.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. added
    new
    and removed
    new
    on Jan 4, 2024
  2. kevinushey commented on Jan 4, 2024

    @kevinushey
    Collaborator

    I wasn't able to reproduce locally. Can you share any other details?

    > Sys.which("quarto")
                                      quarto 
    "/Users/kevin/Desktop/quarto/bin/quarto" 
    > Sys.getenv("RSTUDIO_QUARTO")
    [1] "/Users/kevin/Desktop/quarto/bin/quarto"
    > quarto::quarto_path()
    [1] "/Users/kevin/Desktop/quarto/bin/quarto"
    
  3. kevinushey commented on Jan 4, 2024

    @kevinushey
    Collaborator

    Does it depend on whether you've installed the .tar.gz versus the package installer?

  4. sharon-wang commented on Jan 4, 2024

    @sharon-wang
    Member

    That's a good question. In my case, I downloaded the .tar.gz. Duplicating from the description, this is what did and didn't work for me:

    # this works
    RSTUDIO_QUARTO=/Users/sharon/Documents/quarto/quarto-1.4.534-macos/bin/quarto
    
    # this doesn't work
    RSTUDIO_QUARTO=/Users/sharon/Desktop/quarto/quarto-1.4.534-macos/bin/quarto
    
  5. ronblum commented on Jan 8, 2024

    @ronblum
    ContributorAuthor

    This appears to be happening due to the Python path activation issue which puts /usr/local/bin the front of the path if
    Tools -> Global Options -> Python -> Automatically activate project-level Python environments is checked.

  6. kevinushey commented on Jan 9, 2024

    @kevinushey
    Collaborator

    FWIW I'm not sure if the issue @ronblum was seeing matches what @sharon-wang was seeing. @ronblum's issue is that there are two "things" trying to put Quarto on the PATH:

    1. The detection of RSTUDIO_QUARTO,
    2. The detection of Python.

    If Python is found at /usr/local/bin on the PATH, and quarto is also installed on the PATH there, then that ends up taking precedence over the version found in RSTUDIO_QUARTO.

  7. added this to the Product Backlog milestone on Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions