ruby - Bundle command not found - Jenkinsfile groovy -


i have groovy script runs job in jenkins pipeline fails when trys run bundle. error

bundle: command not found 

i thought including path variable in build process seems not case

node {   stage 'bundle build'   withenv(['path=/usr/bin:/bin:/usr/sbin:/:sbin/usr/local/bin:$path']) {     sh '''bundle'''  } 

}

when run which bundle /users/jenkins/.rvm/gems/ruby/bin/bundle

but builds run under /users/jenkins/.jenkins

how can use bundle when building job?

any appreciated

thanks

update

if run works

node {   stage 'bundle build'   withenv(['path=/usr/bin:/bin:/usr/sbin:/:sbin/usr/local/bin:$path']) {     sh '''#!/bin bash -l           bundle'''  } 

}

but doesnt seem right

try instead

node {   stage 'bundle build'   withenv([       "path=$home/.rbenv/bin:$home/.rbenv/shims:$path",       "rbenv_shell=sh"       ]) {     sh '''bundle'''  } 

please make sure path .rbenv correct


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -