Setting up your own Shiny and RStudio server on a Raspberry Pi

Thank you for this great walkthrough. I am able to install shiny-server. When i try to install r-studio i get this error when i execute ./install-dependencies-debian --exclude-qt-sdk.

I use raspberry pi 3b+. I have read some replies saying that i need to add shebang line to a file. I tried to add to last file which is "subprocess.py" but it has shebang line already. Any help is appreciated.

File "/opt/rstudio-tools/depot_tools/gn.py", line 75, in <module>
    sys.exit(main(sys.argv))
  File "/opt/rstudio-tools/depot_tools/gn.py", line 70, in main
    return subprocess.call([gn_path] + args[1:])
  File "/usr/lib/python2.7/subprocess.py", line 168, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error
1 Like

Thanks for this great guide!

I've accounted next problem, I cannot install dependencies using scripts. Code output:

root@raspberrypi:/srv/shiny-server/rstudio/dependencies/linux# ./install-dependencies-debian
Error: Unsupported Debian release

Similar happens with install-dependencies-stretch.

I'm using Buster release 10.7.19

Any workaround possible?

Thanks for all your time!

Sorry, not that I'm aware of, I'm currently using my Pi in "production", so I can't take it down for the moment to make tests with the new Buster release.

I've tried to modify the stretch dependencies script to install in Buster, but ran into openssl issue when compiling rstudio.

After that I've switched to Raspbian Stretch Lite, did all exactly according to instructions, (only installed cmake 3.15 instead), but when compiling rstudio, next error pops out. Up to rstudio compiling part everything worked without errors.

Any ideas?

Thanks!

BUILD FAILED
/home/pi/rstudio/src/gwt/build.xml:89: Compile failed; see the compiler error output for details.

Total time: 1 minute 43 seconds
src/gwt/CMakeFiles/gwt_build.dir/build.make:57: recipe for target 'gwt_build' failed
make[2]: *** [gwt_build] Error 1
CMakeFiles/Makefile2:117: recipe for target 'src/gwt/CMakeFiles/gwt_build.dir/all' failed
make[1]: *** [src/gwt/CMakeFiles/gwt_build.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

This seems like a problem with the gwt compiler, you can try manually installing the latest compiler, I can't test this solution right now but hopefully it would point you in the right direction.

wget http://dl.google.com/closure-compiler/compiler-latest.zip
unzip compiler-latest.zip
rm COPYING README.md compiler-latest.zip
mv closure-compiler-v20190729.jar /home/pi/rstudio/src/gwt/tools/compiler/compiler.jar

Gettin closer. Now it seems that system runs out of memory:

    [javac] The system is out of resources.
    [javac] Consult the following stack trace for details.
    [javac] java.lang.OutOfMemoryError: Java heap space

Swap is set to 3GB:

pi@raspberrypi:~ $ free -m
              total        used        free      shared  buff/cache   available
Mem:            926          89         580          16         256         768
Swap:          3171           0        3171

I ran htop simultaneously and swap file was not touched during compiling process.
(Working on Rpi 3B+)

That is weird, I have never had that problem, try making sure the swap is on, disabling swappines directive and restarting your pi

sudo /sbin/swapon /var/swap.1

sudo nano /etc/sysctl.conf
# Comment this line
    vm.swappiness=10

SOLVED! (java -Xms1800m)

I tried everything related to swap, fresh Stretch install, instead of adding swap.1 I modified original swap to 5GB, set swapiness to 90 and 100, nothing worked.

After some search, problem was [javac] java.lang.OutOfMemoryError: Java heap space
and problem was solved using java -Xms1800m. After 14h of compiling, server works like charm.

Thanks!

3 Likes

Thank you so much, I am a noob but with instruction on this page I have shiny and studio server running on raspberry pi 4

2 Likes

A post was split to a new topic: shiny is not listening to port 3838