Trouble running Shiny application from MyBinder

Following instructions for using binder with R

I’ve created a repository with a simple Shiny application](GitHub - moldach/scss-shiny: An Binder example of integrating SCSS (and HTML) from CodePen into a Shiny Application)

I enter the link on the binder website and it gives me the following link to share:

But adding the ?urlpath=rstudio to the end doesn’t work


If you check out the different URLs in this example: GitHub - binder-examples/r: Using R with Jupyter / RStudio on Binder - I think your urlpath should be shiny/<path to your app's dashboard>, not rstudio.

Hope that helps!

1 Like

Hi @sgibson91

Gives me an error.

Here’s the full information, I’d appreciate if you could provide the working shiny link for the following:

  1. Github repo containing the Shiny application I want to run in Binder:

_note: FWIW the Shiny app is the app.R file - it has not been deployed on a server - not sure if that matters?

  1. Turn Git repo into Binder link:
Build and launch a repository
GitHub repository name or URL
Git ref (branch, tag, or commit)
Path to a notebook file (optional)
Copy the URL below and share your Binder with others:

Copy to clipboard
Copy the text below, then paste into your README to show a binder badge:
  1. append a bit of text to the URL of our Binder repository, which we can find out at when we enter the URL of our original repository from GitHub. For the Shiny app environment, we must add the following at the end of the URL: ?urlpath=shiny.

_note: in the example provided they also appended ?urlpath=shiny/bus-dashboard/ because the Shiny application lives with a subdirectory in the repo. Mine does not so I should not have to append anything after ?urlpath=shiny.

Sorry, I don’t really know much about R or Shiny apps. But if you’re confident in your link, maybe there’s something up with the app? I don’t think it needs to be deployed anywhere for Binder to run it because it should install and run everything for you. Does it work locally, or using repo2docker?

Despite saying that, I see numerous ways in which you didn’t follow the guide repo.

Once users are more familiar with how MyBinder works and the requirements for various abilities, they can start with a blank repository and convert it to be Binder-ready. As a Binder initiate, the way to go about using the example repositories is to use them, in your case it would be the example R repo that had Jupyter + R, RStudio and RShiny, to make a new repo using the Use this template button, and then gradually convert it to their custom code and see when things break. For example, your repo doesn’t even launch RStudio properly right now. Indeed, when you click on New under the Jupyter Dashboard, you should see R as a kernel choice below Python 3. (Compare what happens when you launch from the example and then click on the Jupyter logo in the upper left to go to the Jupyter Dashboard. The New drop-down menu will be over on the left above the list of files.) You aren’t using the two file approach for your Shiny app, see here and the discussion linked from there. The list of detailed discrepancies goes on and contributes to the symptoms you are seeing.

R not being listed on the New drop-down menu in the Jupyter dashboard from lanches from your repo is a big red-flag. If R isn’t available, you cannot expect much else R-based to work, and so that is a good place to start.
It would probably also help if you searched the terms rstudio and, separately shiny, on this forum and looked at what was discussed and examine repos linked.

1 Like