I have a shiny program in R that works great. But I am having trouble deploying it to shinyapps.io.
The javascript error console gives me the following error:
Listening on http://127.0.0.1:46574
Downloading github repo jlisic/saAlloc@master
Installing saAlloc
'/usr/lib/R/bin/R' --vanilla CMD INSTALL \
'/tmp/RtmpvmoFM3/devtools2c6b564aad/jlisic-saAlloc-62692fc' \
--library='/usr/local/lib/R/site-library' --install-tests
Error: ERROR: no permission to install to directory ‘/usr/local/lib/R/site-library’
Error : Command failed (1)
There is nothing fancy about my package it just has a default Makevars file. Any help or suggestions would be appreciated.
GitHub is a great place to organise and share your code using version control. You can also use it to host Shiny app code for others to download and run on their own computer.
To deploy your application, use the deployApp command from the rsconnect packages. If you're using the RStudio IDE, you can also deploy your application by clicking the Publish button while viewing the application. Once the deployment finishes, your browser should open automatically to your newly deployed application.
New to Shiny? Deploy your applications for FREE.
Shiny Server enables users to host and manage Shiny applications on the Internet. Shiny is an R package that uses a reactive programming model to simplify the development of R-powered web applications. Shiny Server can manage R processes running various Shiny applications over different URLs and ports.
I have also been struggling with this issue, and I just found a working answer in the shinyapps.io Google users group by @Yihui. Quoting his post:
You should not install the package inside your app (i.e. do not call
install_github()
in your app code). Just install it locally, and shinyapps.io will figure out how to install it on the server.
https://groups.google.com/d/msg/shinyapps-users/5S8jTJ-SeHM/HCPGUjYVUM4J
Removing the devtools::install_github()
line in server.R
worked for me. Back end magic!
EDIT: The reason why this works is explained in more detail in this rsconnect
issue: https://github.com/rstudio/rsconnect/issues/88
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With