How to fix “Unable to find GhostScript executable to run checks on size reduction” error upon package...





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







2















In Revolution R Enterprise console,



devtools::check("C:/Users/User/Documents/Revolution/mypackage")


produced



checking sizes of PDF files under 'inst/doc' ... NOTE
Unable to find GhostScript executable to run checks on size reduction


with no any other warnings/errors/notes. So, (even though AFAIK this note is not that much important for eventual check), I wanted to get rid of this warning (since I wanna put .PDF files into mypackageinstdoc folder produced outside of R).



I have Ghostscript installed in my notebook. I got helped via:



> help("R_GSCMD")
R_GSCMD: Optional. The path to Ghostscript, used by dev2bitmap, bitmap and embedFonts.
Consulted when those functions are invoked.
Since it will be treated as if passed to system, spaces and shell metacharacters should be escaped.


> Sys.getenv("R_GSCMD")
[1] ""


What I did (and took error again) is:



> Sys.setenv("R_GSCMD") <- "C:\Program Files (x86)\gs\gs9.19\bin\gswin32c.exe"
Error in Sys.setenv("R_GSCMD") <- "C:\Program Files (x86)\gs\gs9.19\bin\gswin32c.exe" :
target of assignment expands to non-language object


Upon deepening, I found: ["These errors occur when one tries to assign a value to a variable that doesn't exist, or that R can't treat as a name. (A name is a variable type that holds a variable name."]



What I am basically trying to do is to set my GS executable (C:Program Files (x86)gsgs9.19bingswin32c.exe) to "R_GSCMD".
Any help would be greatly appreciated.










share|improve this question





























    2















    In Revolution R Enterprise console,



    devtools::check("C:/Users/User/Documents/Revolution/mypackage")


    produced



    checking sizes of PDF files under 'inst/doc' ... NOTE
    Unable to find GhostScript executable to run checks on size reduction


    with no any other warnings/errors/notes. So, (even though AFAIK this note is not that much important for eventual check), I wanted to get rid of this warning (since I wanna put .PDF files into mypackageinstdoc folder produced outside of R).



    I have Ghostscript installed in my notebook. I got helped via:



    > help("R_GSCMD")
    R_GSCMD: Optional. The path to Ghostscript, used by dev2bitmap, bitmap and embedFonts.
    Consulted when those functions are invoked.
    Since it will be treated as if passed to system, spaces and shell metacharacters should be escaped.


    > Sys.getenv("R_GSCMD")
    [1] ""


    What I did (and took error again) is:



    > Sys.setenv("R_GSCMD") <- "C:\Program Files (x86)\gs\gs9.19\bin\gswin32c.exe"
    Error in Sys.setenv("R_GSCMD") <- "C:\Program Files (x86)\gs\gs9.19\bin\gswin32c.exe" :
    target of assignment expands to non-language object


    Upon deepening, I found: ["These errors occur when one tries to assign a value to a variable that doesn't exist, or that R can't treat as a name. (A name is a variable type that holds a variable name."]



    What I am basically trying to do is to set my GS executable (C:Program Files (x86)gsgs9.19bingswin32c.exe) to "R_GSCMD".
    Any help would be greatly appreciated.










    share|improve this question

























      2












      2








      2








      In Revolution R Enterprise console,



      devtools::check("C:/Users/User/Documents/Revolution/mypackage")


      produced



      checking sizes of PDF files under 'inst/doc' ... NOTE
      Unable to find GhostScript executable to run checks on size reduction


      with no any other warnings/errors/notes. So, (even though AFAIK this note is not that much important for eventual check), I wanted to get rid of this warning (since I wanna put .PDF files into mypackageinstdoc folder produced outside of R).



      I have Ghostscript installed in my notebook. I got helped via:



      > help("R_GSCMD")
      R_GSCMD: Optional. The path to Ghostscript, used by dev2bitmap, bitmap and embedFonts.
      Consulted when those functions are invoked.
      Since it will be treated as if passed to system, spaces and shell metacharacters should be escaped.


      > Sys.getenv("R_GSCMD")
      [1] ""


      What I did (and took error again) is:



      > Sys.setenv("R_GSCMD") <- "C:\Program Files (x86)\gs\gs9.19\bin\gswin32c.exe"
      Error in Sys.setenv("R_GSCMD") <- "C:\Program Files (x86)\gs\gs9.19\bin\gswin32c.exe" :
      target of assignment expands to non-language object


      Upon deepening, I found: ["These errors occur when one tries to assign a value to a variable that doesn't exist, or that R can't treat as a name. (A name is a variable type that holds a variable name."]



      What I am basically trying to do is to set my GS executable (C:Program Files (x86)gsgs9.19bingswin32c.exe) to "R_GSCMD".
      Any help would be greatly appreciated.










      share|improve this question














      In Revolution R Enterprise console,



      devtools::check("C:/Users/User/Documents/Revolution/mypackage")


      produced



      checking sizes of PDF files under 'inst/doc' ... NOTE
      Unable to find GhostScript executable to run checks on size reduction


      with no any other warnings/errors/notes. So, (even though AFAIK this note is not that much important for eventual check), I wanted to get rid of this warning (since I wanna put .PDF files into mypackageinstdoc folder produced outside of R).



      I have Ghostscript installed in my notebook. I got helped via:



      > help("R_GSCMD")
      R_GSCMD: Optional. The path to Ghostscript, used by dev2bitmap, bitmap and embedFonts.
      Consulted when those functions are invoked.
      Since it will be treated as if passed to system, spaces and shell metacharacters should be escaped.


      > Sys.getenv("R_GSCMD")
      [1] ""


      What I did (and took error again) is:



      > Sys.setenv("R_GSCMD") <- "C:\Program Files (x86)\gs\gs9.19\bin\gswin32c.exe"
      Error in Sys.setenv("R_GSCMD") <- "C:\Program Files (x86)\gs\gs9.19\bin\gswin32c.exe" :
      target of assignment expands to non-language object


      Upon deepening, I found: ["These errors occur when one tries to assign a value to a variable that doesn't exist, or that R can't treat as a name. (A name is a variable type that holds a variable name."]



      What I am basically trying to do is to set my GS executable (C:Program Files (x86)gsgs9.19bingswin32c.exe) to "R_GSCMD".
      Any help would be greatly appreciated.







      r ghostscript setenv






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 12 '16 at 21:21









      Erdogan CEVHERErdogan CEVHER

      866823




      866823
























          2 Answers
          2






          active

          oldest

          votes


















          3














          On consulting ?Sys.setenv it confirms my expectation that the call should instead be:



          Sys.setenv(R_GSCMD = "C:\Program Files (x86)\gs\gs9.19\bin\gswin32c.exe")





          share|improve this answer
























          • It worked. Perhaps, this could be given in R teaching materials where assignments are covered to get users accustomed to different assignment styles.

            – Erdogan CEVHER
            May 13 '16 at 4:19











          • I agree that R functions do seem somewhat "irregular". The system setting done with options always seemed odd to me as well. I need to check the help pages every time.

            – 42-
            May 13 '16 at 5:12











          • Adding "C:Program Files (x86)gsgs9.19bin" to "Path" variable in System Environment Variables solved my "Unable to find GhostScript executable..." issue permanently (for every R session). To add, I did this: My Computer - rightclick - properties - Advanced system settings - Advanced tab in System Properties window - Environment variables - Click "Path" in System variables - Edit - add ";C:Program Files (x86)gsgs9.19bin" to the end of line.

            – Erdogan CEVHER
            May 13 '16 at 7:10



















          0














          Because the gs versions change all the time, you may like a little R script for it!



          system.partition = 'c:'
          dirs = c('Program Files', 'Program Files (x86)')
          for (dir in dirs) {
          dir.list = list.dirs(file.path(system.partition, dir), recursive = FALSE)
          GsinList = grepl(pattern = 'gs', x = dir.list)
          if (sum(GsinList) > 0) {
          gsDirectory = which(GsinList == TRUE)
          GsExeFiles = list.files(
          dir.list[gsDirectory],
          recursive = TRUE,
          pattern = 'gswin',
          include.dirs = TRUE,
          full.names = TRUE
          )[1]
          message('Gs found! ~> ',GsExeFiles)
          Sys.setenv(R_GSCMD = GsExeFiles)
          break
          }
          }


          Gs found! ~> c:/Program Files/gs/gs9.21/bin/gswin64.exe





          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f37197603%2fhow-to-fix-unable-to-find-ghostscript-executable-to-run-checks-on-size-reductio%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            On consulting ?Sys.setenv it confirms my expectation that the call should instead be:



            Sys.setenv(R_GSCMD = "C:\Program Files (x86)\gs\gs9.19\bin\gswin32c.exe")





            share|improve this answer
























            • It worked. Perhaps, this could be given in R teaching materials where assignments are covered to get users accustomed to different assignment styles.

              – Erdogan CEVHER
              May 13 '16 at 4:19











            • I agree that R functions do seem somewhat "irregular". The system setting done with options always seemed odd to me as well. I need to check the help pages every time.

              – 42-
              May 13 '16 at 5:12











            • Adding "C:Program Files (x86)gsgs9.19bin" to "Path" variable in System Environment Variables solved my "Unable to find GhostScript executable..." issue permanently (for every R session). To add, I did this: My Computer - rightclick - properties - Advanced system settings - Advanced tab in System Properties window - Environment variables - Click "Path" in System variables - Edit - add ";C:Program Files (x86)gsgs9.19bin" to the end of line.

              – Erdogan CEVHER
              May 13 '16 at 7:10
















            3














            On consulting ?Sys.setenv it confirms my expectation that the call should instead be:



            Sys.setenv(R_GSCMD = "C:\Program Files (x86)\gs\gs9.19\bin\gswin32c.exe")





            share|improve this answer
























            • It worked. Perhaps, this could be given in R teaching materials where assignments are covered to get users accustomed to different assignment styles.

              – Erdogan CEVHER
              May 13 '16 at 4:19











            • I agree that R functions do seem somewhat "irregular". The system setting done with options always seemed odd to me as well. I need to check the help pages every time.

              – 42-
              May 13 '16 at 5:12











            • Adding "C:Program Files (x86)gsgs9.19bin" to "Path" variable in System Environment Variables solved my "Unable to find GhostScript executable..." issue permanently (for every R session). To add, I did this: My Computer - rightclick - properties - Advanced system settings - Advanced tab in System Properties window - Environment variables - Click "Path" in System variables - Edit - add ";C:Program Files (x86)gsgs9.19bin" to the end of line.

              – Erdogan CEVHER
              May 13 '16 at 7:10














            3












            3








            3







            On consulting ?Sys.setenv it confirms my expectation that the call should instead be:



            Sys.setenv(R_GSCMD = "C:\Program Files (x86)\gs\gs9.19\bin\gswin32c.exe")





            share|improve this answer













            On consulting ?Sys.setenv it confirms my expectation that the call should instead be:



            Sys.setenv(R_GSCMD = "C:\Program Files (x86)\gs\gs9.19\bin\gswin32c.exe")






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered May 12 '16 at 21:57









            42-42-

            216k15267403




            216k15267403













            • It worked. Perhaps, this could be given in R teaching materials where assignments are covered to get users accustomed to different assignment styles.

              – Erdogan CEVHER
              May 13 '16 at 4:19











            • I agree that R functions do seem somewhat "irregular". The system setting done with options always seemed odd to me as well. I need to check the help pages every time.

              – 42-
              May 13 '16 at 5:12











            • Adding "C:Program Files (x86)gsgs9.19bin" to "Path" variable in System Environment Variables solved my "Unable to find GhostScript executable..." issue permanently (for every R session). To add, I did this: My Computer - rightclick - properties - Advanced system settings - Advanced tab in System Properties window - Environment variables - Click "Path" in System variables - Edit - add ";C:Program Files (x86)gsgs9.19bin" to the end of line.

              – Erdogan CEVHER
              May 13 '16 at 7:10



















            • It worked. Perhaps, this could be given in R teaching materials where assignments are covered to get users accustomed to different assignment styles.

              – Erdogan CEVHER
              May 13 '16 at 4:19











            • I agree that R functions do seem somewhat "irregular". The system setting done with options always seemed odd to me as well. I need to check the help pages every time.

              – 42-
              May 13 '16 at 5:12











            • Adding "C:Program Files (x86)gsgs9.19bin" to "Path" variable in System Environment Variables solved my "Unable to find GhostScript executable..." issue permanently (for every R session). To add, I did this: My Computer - rightclick - properties - Advanced system settings - Advanced tab in System Properties window - Environment variables - Click "Path" in System variables - Edit - add ";C:Program Files (x86)gsgs9.19bin" to the end of line.

              – Erdogan CEVHER
              May 13 '16 at 7:10

















            It worked. Perhaps, this could be given in R teaching materials where assignments are covered to get users accustomed to different assignment styles.

            – Erdogan CEVHER
            May 13 '16 at 4:19





            It worked. Perhaps, this could be given in R teaching materials where assignments are covered to get users accustomed to different assignment styles.

            – Erdogan CEVHER
            May 13 '16 at 4:19













            I agree that R functions do seem somewhat "irregular". The system setting done with options always seemed odd to me as well. I need to check the help pages every time.

            – 42-
            May 13 '16 at 5:12





            I agree that R functions do seem somewhat "irregular". The system setting done with options always seemed odd to me as well. I need to check the help pages every time.

            – 42-
            May 13 '16 at 5:12













            Adding "C:Program Files (x86)gsgs9.19bin" to "Path" variable in System Environment Variables solved my "Unable to find GhostScript executable..." issue permanently (for every R session). To add, I did this: My Computer - rightclick - properties - Advanced system settings - Advanced tab in System Properties window - Environment variables - Click "Path" in System variables - Edit - add ";C:Program Files (x86)gsgs9.19bin" to the end of line.

            – Erdogan CEVHER
            May 13 '16 at 7:10





            Adding "C:Program Files (x86)gsgs9.19bin" to "Path" variable in System Environment Variables solved my "Unable to find GhostScript executable..." issue permanently (for every R session). To add, I did this: My Computer - rightclick - properties - Advanced system settings - Advanced tab in System Properties window - Environment variables - Click "Path" in System variables - Edit - add ";C:Program Files (x86)gsgs9.19bin" to the end of line.

            – Erdogan CEVHER
            May 13 '16 at 7:10













            0














            Because the gs versions change all the time, you may like a little R script for it!



            system.partition = 'c:'
            dirs = c('Program Files', 'Program Files (x86)')
            for (dir in dirs) {
            dir.list = list.dirs(file.path(system.partition, dir), recursive = FALSE)
            GsinList = grepl(pattern = 'gs', x = dir.list)
            if (sum(GsinList) > 0) {
            gsDirectory = which(GsinList == TRUE)
            GsExeFiles = list.files(
            dir.list[gsDirectory],
            recursive = TRUE,
            pattern = 'gswin',
            include.dirs = TRUE,
            full.names = TRUE
            )[1]
            message('Gs found! ~> ',GsExeFiles)
            Sys.setenv(R_GSCMD = GsExeFiles)
            break
            }
            }


            Gs found! ~> c:/Program Files/gs/gs9.21/bin/gswin64.exe





            share|improve this answer




























              0














              Because the gs versions change all the time, you may like a little R script for it!



              system.partition = 'c:'
              dirs = c('Program Files', 'Program Files (x86)')
              for (dir in dirs) {
              dir.list = list.dirs(file.path(system.partition, dir), recursive = FALSE)
              GsinList = grepl(pattern = 'gs', x = dir.list)
              if (sum(GsinList) > 0) {
              gsDirectory = which(GsinList == TRUE)
              GsExeFiles = list.files(
              dir.list[gsDirectory],
              recursive = TRUE,
              pattern = 'gswin',
              include.dirs = TRUE,
              full.names = TRUE
              )[1]
              message('Gs found! ~> ',GsExeFiles)
              Sys.setenv(R_GSCMD = GsExeFiles)
              break
              }
              }


              Gs found! ~> c:/Program Files/gs/gs9.21/bin/gswin64.exe





              share|improve this answer


























                0












                0








                0







                Because the gs versions change all the time, you may like a little R script for it!



                system.partition = 'c:'
                dirs = c('Program Files', 'Program Files (x86)')
                for (dir in dirs) {
                dir.list = list.dirs(file.path(system.partition, dir), recursive = FALSE)
                GsinList = grepl(pattern = 'gs', x = dir.list)
                if (sum(GsinList) > 0) {
                gsDirectory = which(GsinList == TRUE)
                GsExeFiles = list.files(
                dir.list[gsDirectory],
                recursive = TRUE,
                pattern = 'gswin',
                include.dirs = TRUE,
                full.names = TRUE
                )[1]
                message('Gs found! ~> ',GsExeFiles)
                Sys.setenv(R_GSCMD = GsExeFiles)
                break
                }
                }


                Gs found! ~> c:/Program Files/gs/gs9.21/bin/gswin64.exe





                share|improve this answer













                Because the gs versions change all the time, you may like a little R script for it!



                system.partition = 'c:'
                dirs = c('Program Files', 'Program Files (x86)')
                for (dir in dirs) {
                dir.list = list.dirs(file.path(system.partition, dir), recursive = FALSE)
                GsinList = grepl(pattern = 'gs', x = dir.list)
                if (sum(GsinList) > 0) {
                gsDirectory = which(GsinList == TRUE)
                GsExeFiles = list.files(
                dir.list[gsDirectory],
                recursive = TRUE,
                pattern = 'gswin',
                include.dirs = TRUE,
                full.names = TRUE
                )[1]
                message('Gs found! ~> ',GsExeFiles)
                Sys.setenv(R_GSCMD = GsExeFiles)
                break
                }
                }


                Gs found! ~> c:/Program Files/gs/gs9.21/bin/gswin64.exe






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 3 at 10:58









                TPArrowTPArrow

                807916




                807916






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f37197603%2fhow-to-fix-unable-to-find-ghostscript-executable-to-run-checks-on-size-reductio%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    MongoDB - Not Authorized To Execute Command

                    How to fix TextFormField cause rebuild widget in Flutter

                    in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith