Skip to content

Frequently Asked Questions

Why can’t I load my package? It is listed my config file and I ran rv sync

Section titled “Why can’t I load my package? It is listed my config file and I ran rv sync”

If you are getting an error like the following

Terminal window
> library(dplyr)
Error in `library()`:
! there is no package called 'dplyr'
Show Traceback

It is likely because your .libPaths() is not set to the rv library path.

There are a few reasons this can occur:

1. Your .Rprofile is not sourcing rv/scripts/activate.R

Section titled “1. Your .Rprofile is not sourcing rv/scripts/activate.R”
  • Run restart R or run source(".Rprofile"). After either, you should see a message containing the following:
    rv libpaths active!
    library paths:
    /Users/rv-user/projects/prism-pkg-pub/rv/library/4.4/arm64
    /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
  • Ensure rv/scripts/activate.R is present in your directory. If it is not, run rv activate and restart R.
  • Ensure source("rv/scripts/activate.R") is present in your .Rprofile. If it is not, add it as the first line

2. You are launching a background job from a subdirectory that does not contain a .Rprofile

Section titled “2. You are launching a background job from a subdirectory that does not contain a .Rprofile”

This often occurs when rendering a quarto document. See rv with quarto for more information.