rkrug / plantuml

R package to build UML graphs using plantuml
https://rkrug.github.io/plantuml/index.html
GNU General Public License v3.0
76 stars 8 forks source link

First example: Permission denied #19

Closed azzaea closed 3 years ago

azzaea commented 3 years ago

Hello,

Thank you for providing this package. I just installed the package, but keep getting a Permission denied error as below upon running the first example in the README. Would you kindly advise?

Thank you, Azza

> plot( 
+   x = x
+   # vector = TRUE
+ )
sh: 1: : Permission denied
[1] 127
Warning message:
In system2(command = java_bin, args = paste(java_opt, cmd, plantuml_opt),  :
  error in running command

Here are my session info:


> sessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] flow_0.0.2   plantuml_0.4

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6        compiler_4.0.5    pillar_1.6.0      R.utils_2.10.1    R.methodsS3_1.8.1
 [6] prettyunits_1.1.1 remotes_2.3.0     tools_4.0.5       digest_0.6.27     testthat_3.0.2   
[11] pkgbuild_1.2.0    pkgload_1.2.1     jsonlite_1.7.2    R.cache_0.15.0    memoise_2.0.0    
[16] lifecycle_1.0.0   tibble_3.1.1      pkgconfig_2.0.3   png_0.1-7         rlang_0.4.11     
[21] rstudioapi_0.13   cli_2.5.0         yaml_2.2.1        nomnoml_0.2.3     curl_4.3         
[26] fastmap_1.1.0     withr_2.4.2       styler_1.4.1      htmlwidgets_1.5.3 desc_1.3.0       
[31] fs_1.5.0          vctrs_0.3.8       devtools_2.4.1    rprojroot_2.0.2   grid_4.0.5       
[36] grImport_0.9-3    glue_1.4.2        R6_2.5.0          processx_3.5.2    fansi_0.4.2      
[41] XML_3.99-0.6      pacman_0.5.1      sessioninfo_1.1.1 callr_3.7.0       purrr_0.3.4      
[46] magrittr_2.0.1    htmltools_0.5.1.1 backports_1.2.1   ps_1.6.0          ellipsis_0.3.2   
[51] usethis_2.0.1     utf8_1.2.1        cachem_1.0.4      crayon_1.4.1      R.oo_1.24.0      
> 
rkrug commented 3 years ago

Permissions are usually local system specific. You should look if you can execute plantuml from the command line as described here.

If this runs, the function which executes the system2() call is plantuml_run (), so you could step through that function to get the command executed and that try that one from the terminal. This is in line https://github.com/rkrug/plantuml/blob/23db23cd9b99975eb9d2402a6e95c0efea7c0b9b/R/plantuml_run.R#L65

Let me know if this does not help, and I can take a closer look.

azzaea commented 3 years ago

Thank you much for the hint and help.

I looked around a bit, and the problem is now solved on my system (but I'm not clear on why- I haven't modified the package internally or particularly installed plantuml-related package). Nonetheless, here is what I did:

> plantuml_update()
trying URL 'https://sourceforge.net/projects/plantuml/files/latest/download'
Content type 'application/java-archive' length 8346090 bytes (8.0 MB)
==================================================
downloaded 8.0 MB

[1] "/home/azza/.cache/R/plantuml/jar/plantuml.jar"
$ ll -h /home/azza/.cache/R/plantuml/jar/plantuml.jar
-rw-rw-r-- 1 azza azza 8.0M May 25 04:00 /home/azza/.cache/R/plantuml/jar/plantuml.jar
$ java -jar /home/azza/.cache/R/pl
antuml/jar/plantuml.jar -help
Usage: java -jar plantuml.jar [options] -gui
        (to execute the GUI)
    or java -jar plantuml.jar [options] [file/dir] [file/dir] [file/dir]
        (to process files or directories)
:
:
$ chmod +x  /home/azza/.cache/R/plantuml/jar/plantuml.jar
> plot( 
+     x = x
+     # vector = TRUE
+ )
[1] 0

Again, thank you much. Please feel free to close

rkrug commented 3 years ago

Good to hear that it is working now.