where bundle is Ruby package manager and it fails:
What went wrong:
Execution failed for task ‘:ModuleName:installGems’.
A problem occurred starting process ‘command ‘bundle’’
As you can see parent problems happens in specific module not in parent.
But if i change Gradle version in Gradle wrapper from 2.12 to 2.11 everything is working. Plus, what more interesting if i manually call from my terminal
bundle check or
bundle install
everything is working. My guess is since i call Gradle wrapper from parent folder compare to ModuleName Gradle is trying to execute those Exec commands from parent folder and since parent folder does not have any signs of Ruby gems it fails as described above. Please let me know about any suggestions.
P.S. I’m sorry if misunderstood something, but i googled first and didn’t find right topics/answers
Try running Gradle with --info. That should print out the working directory and command line being executed. The Exec task should run from the current project directory.
You should never call execute() on a task. I think what you really want is…
Sorry, for confuse, but this elegant solution is working on Gradle below 2.12 and if i try Gradle 2.12 i have next output:
Starting process ‘command ‘bundle’’. Working directory: /path/to/ModuleName Command: bundle check
:ModuleName:installGems FAILED
:ModuleName:installGems (Thread[Daemon worker Thread 43,5,main]) completed. Took 0.005 secs.
FAILURE: Build failed with an exception.
What went wrong:
Could not evaluate onlyIf predicate for task ‘:ModuleName:installGems’.
A problem occurred starting process ‘command ‘bundle’’
Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
So, as i can see Gradle is not seeing bundle command. Either issue in Gradle or in my recently updated OS (Capitan) - IMHO. Something inside me tells this is OS issue since i tested same script on CentOS and nothing suspicious - worked as supposed. Exclude one of them is really complicated - please advise
I think finally figured out the problem. So, first of all(if i understand correctly) there is no such term as PATH for ruby gems. Issue comes as i expected from Mac OS Upgrade (EL Capitan). Apple added additional security and if you use Ruby/Gems OOTB(i’m talking about pre-configured stuff) then you gonna have issues to get access those Gems using Gradle. I had to configure Ruby/Gems from scratch and put it to my custom folder(s) and now Gradle is seeing bundle command. On another hand if i switch for instance to Gradle 2.11 build also working. So, in 90% i’m sure this issue happens because of OS Update and in 10% that something was made in Gradle 2.12. I leave this decision for you, if you find answer - let US know.