run_as user does not give access to user specific .libPaths()


I am trying to deploy shiny apps using shiny server from my local workstation. The sample-apps work however my app does not deploy after placing in the /srv/shiny-server directory. I checked with sudo su shiny and the checking .libPaths() which are:

[1] "/usr/local/lib/R/site-library"                 
[2] "/usr/lib/R/site-library"                       
[3] "/usr/lib/R/library"     

however, my user specific library is "/home/nfancy/R/x86_64-pc-linux-gnu-library/3.6".

My conf file is as below:

# Instruct Shiny Server to run applications as the user "shiny"
run_as nfancy;

# Define a server that listens on port 3838
server {
  listen 3838;

  # Define a location at the base URL
  location / {

    # Host the directory of Shiny Apps stored in this directory
    site_dir /srv/shiny-server;

    # Log all Shiny output to files in this directory
    log_dir /var/log/shiny-server;

    # When a user visits the base URL rather than a particular application,
    # an index of the applications available in this directory will be shown.
    directory_index on;

This is the output of cat /var/log/shiny-server.log

[2022-06-20T16:24:37.139] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.

Can someone please guide me to solve the issue?