Giter Club home page Giter Club logo

Comments (6)

virtualstaticvoid avatar virtualstaticvoid commented on September 27, 2024

Hi @ajuancer

I haven't tried this, my suspicion is that the site_dir path needs to be an absolute path, which in this case will need to be /app/ since that is where your application will be installed by the buildpack (and default of Heroku).

Thus your shiny-servr.conf file as follows:

server {
  location / {
    site_dir /app/;
  }
}

Let me know if it works.

from heroku-buildpack-r.

virtualstaticvoid avatar virtualstaticvoid commented on September 27, 2024

Adding to the above, it may be possible to use a relative path for the site_dir in respect of the location of the shiny-servr.conf file. I haven't tried this so please let me know it it works for you. This is a better solution, since it is more portable; you can run your Shiny application on your computer and Heroku without any difference to the code.

server {
  location / {
    site_dir ./;
  }
}

from heroku-buildpack-r.

ajuancer avatar ajuancer commented on September 27, 2024

nope! neither the /app/ dir nor the ./ dir worked.

Even using the relative path, RStudio does not detect the project (but recognizes each of the apps independently, so I can run each app separately). As far as I understand, the only way to test an application directory locally is to install RStudio Server, as opposed to the simplicity of running a single application server from within RStudio itself.

The problem that I have when I try to deploy to Heroku is the following:

-----> Building on the Heroku-18 stack
-----> Using buildpack: https://github.com/virtualstaticvoid/heroku-buildpack-r.git
-----> App not compatible with buildpack: https://github.com/virtualstaticvoid/heroku-buildpack-r.git
       More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
 !     Push failed

which maybe is related to the fact that none of the usual files are present. This assumption may be more than incorrect, I leave it up to you who really know how this buildpack works.

Thanks!!


If someone is having the same problem, a temporary solution may be ti use shinydashnoard.

from heroku-buildpack-r.

virtualstaticvoid avatar virtualstaticvoid commented on September 27, 2024

Hi @ajuancer

Yeah, the detection logic of the buildpack will result in the "App not compatible with buildpack" error message when at least one of the required files aren't present.

If you can place an empty init.R in the root of your project, the buildpack will correctly detect your project as an R application.

Apologies, I assumed from initial issue description, that you had been able to deploy the application, and that it was Shiny that wasn't able to load/run the "nested" applications, which lead me to think the issue was the site_dir path.

From your comment:

As far as I understand, the only way to test an application directory locally is to install RStudio Server.

I did some reading up on Shiny Server and found that it would need to be installed together with your application on Heroku in order to work, and there isn't an easy way to do that unfortunately.

from heroku-buildpack-r.

virtualstaticvoid avatar virtualstaticvoid commented on September 27, 2024

I've create an example project which uses Heroku's container stack and the heroku-docker-r image, instead of the buildpack, to demonstrate how to run multiple Shiny applications with the Shiny Server.

from heroku-buildpack-r.

ajuancer avatar ajuancer commented on September 27, 2024

hi there!

I assumed from initial issue description, that you had been able to deploy the application.

I meant that the application was working before I tried to switch from hosting one to multiple applications. Sorry for the confusion!

I have tried creating an empty file server.R but when I deployed it, I got the push rejected:

! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/repo.git'

As this is usually the result of Heroku having seen new versions in the branch in question, I made a git pull but everything was up to date (as it should be). I tried with git fetch but no changes happened (again, as it should be). Finally, I decided to lost the project with git reset --hard heroku/main and created again the files of the issue.

Recreating the scenario, I have faced again with the failed to push some refs to 'https://git.heroku.com/repo.git'. The error disappears when I copy the run.R1 of one of the working apps to the root dir (where the empty server.R is). I pushed the changes and the app was built successful, but when I visit the deployed page, I got the usually RServer error no UI found.

I created an index.html in a new www dir and deployed it again. Now the server serves that page, but when I navigate to /app1 or /app2 I get a not found response.

As this error remains, I decided to clone your example. Yep! All working nice! 😄 As I have said before, I have no important code in the project so I will start again based on your example.

I leave it up to you to close the issue in case you want to add something.

Thank you very much for all you have done, I really appreciate the effort.


[1]: Continuing the debugging I also tried with one of the server.R of one of the working apps but I got again the refs error. run.R does not contain anything special, and the fact that I can deploy the app with it at the root dir and not with the server.R file is the least I understand about this error.

from heroku-buildpack-r.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.