Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle build fail with Cannot run program No such file or directory

Tags:

gradle

I have a gradle build file with the following task which need to run sphinx-build, I'm running it on Mac OS X with the gradle information bellow.

task makeDocs(type:Exec) {
    workingDir 'sphinx'
    commandLine 'sphinx-build'
    args = ["-b", "html", "-d", "build/doctrees", "-t", "$platformDir", "build/ppsource", "build/html"]
}

When I run this task I get the following exception:

Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'sphinx-build'
    at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
    at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
    at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:65)
    ... 1 more
Caused by: java.io.IOException: Cannot run program "sphinx-build" (in directory "/Users/idoran/Documents/Seebo/dev/SDK/seebosdk_docs/sphinx"): error=2, No such file or directory
    at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
    ... 3 more
Caused by: java.io.IOException: error=2, No such file or directory

When I run sphinx-build from the same terminal everything works fine.


$ gradle --version

------------------------------------------------------------
Gradle 2.2.1
------------------------------------------------------------

Build time:   2014-11-24 09:45:35 UTC
Build number: none
Revision:     6fcb59c06f43a4e6b1bcb401f7686a8601a1fb4a

Groovy:       2.3.6
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.8.0_65 (Oracle Corporation 25.65-b01)
OS:           Mac OS X 10.10.5 x86_64
like image 544
Ido Ran Avatar asked May 19 '16 09:05

Ido Ran


People also ask

How do I run a gradle command in Jenkins?

Create a Jenkins jobFrom the left navigation bar select "New Item > Freestyle project". Enter a new name for the project. We'll pick "gradle-site-plugin" for the project. Select the radio button "Git" in the section "Source Code Management".

How do you clean Gradlew?

To clean cache in react native, open terminal, go to your project android folder, and run gradlew clean command it will clear react native cache.

Why does gradle Sync Fail?

In some cases when your Gradle files are deleted or corrupted you will not be able to download new Gradle files in android studio. In this case, we have to delete the Gradle files which are present already and then again sync your project to download our Gradle files again.

How do I sync build gradle?

Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.


1 Answers

Try stopping the gradle daemon with ./gradlew --stop

I had the same problem with something as simple as:

commandLine = [ "node", "--version"]

It came down to the gradle daemon having a cached location of node which no longer existed (I had updated node sometime before).

like image 161
Steve-B Avatar answered Sep 19 '22 13:09

Steve-B