Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-11159

Rake Plugin invocation on windows cannot find rake.bat

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • rake-plugin
    • None

      In my case I have a multi-configuration project that needs to invoke a rake task on windows, mac, and linux environments. The job on the windows node fails to find 'rake.bat'. It is in the windows system PATH and I can run it from the local machine cmd prompt.

      I believe this would work if I could select "Rake" from the list of tool locations on the Node Configuration page for my windows slave. Installing the rake plugin does not add Rake to the list of node tool installations.

      The full error is:

      [windows] $ rake.bat build:release
      The system cannot find the file specified
      FATAL: rake execution failed
      java.io.IOException: Cannot run program "rake.bat" (in directory "C:\jenkins\workspace\project\label\windows"): CreateProcess error=2, The system cannot find the file specified
      at java.lang.ProcessBuilder.start(Unknown Source)
      at hudson.Proc$LocalProc.<init>(Proc.java:244)
      at hudson.Proc$LocalProc.<init>(Proc.java:216)
      at hudson.Launcher$LocalLauncher.launch(Launcher.java:698)
      at hudson.Launcher$ProcStarter.start(Launcher.java:329)
      at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:923)
      at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:890)
      at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:287)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
      Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
      at java.lang.ProcessImpl.create(Native Method)
      at java.lang.ProcessImpl.<init>(Unknown Source)
      at java.lang.ProcessImpl.start(Unknown Source)
      ... 16 more
      Build step 'Invoke Rake' marked build as failure
      Recording test results
      Notifying upstream projects of job completion
      Finished: FAILURE

          [JENKINS-11159] Rake Plugin invocation on windows cannot find rake.bat

          Rick Beyer added a comment -

          I'm experiencing this same issue but I only have a Windows node. I even tried moving the rake.bat file into the location it thinks it should be in (and looks for it in) and it still gives me the same error.

          Rick Beyer added a comment - I'm experiencing this same issue but I only have a Windows node. I even tried moving the rake.bat file into the location it thinks it should be in (and looks for it in) and it still gives me the same error.

          Rick Beyer added a comment -

          I was able to work around this issue by downloading the source code and manually creating my own RubyInstallation within Rake.java The RubyInstallation rake object was never being created (was always null).

          Rick Beyer added a comment - I was able to work around this issue by downloading the source code and manually creating my own RubyInstallation within Rake.java The RubyInstallation rake object was never being created (was always null).

          Michael Sica added a comment -

          This issue went away for me when I moved the PATH variable for my ruby VM from my User variables list, to my System variables list. (I've now bumped into another blocker, but that setting change got me past this point.)

          Michael Sica added a comment - This issue went away for me when I moved the PATH variable for my ruby VM from my User variables list, to my System variables list. (I've now bumped into another blocker, but that setting change got me past this point.)

            david_calavera david_calavera
            bleonard Brad Leonard
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: