jenkens在mac下出现command not found

项目使用jenkens进行自动打包。

打包后生成的安装包上传至我们的ftp服务器供后续下载用。

上传使用的是lftp

一直提示:

/Users/sanx/Documents/sftp_upload_shell/moon_sftp_upload_10.234.10.12.sh: line 9: lftp: command not found

在网上搜索一下:http://stackoverflow.com/questions/12194294/command-not-found-in-jenkins-running-on-mac-machine

提示说可能是PATH的环境变量,jenkens使用的不相同。

于是输出登陆用户的PATH

sanxdeMac-mini-2:bin sanx$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

然后使用jenkens执行输出PATH

path1:/usr/bin:/bin:/usr/sbin:/sbin

lftp是使用的brew安装的,放在了/usr/local/bin目录下

sanxdeMac-mini-2:bin sanx$ which lftp
/usr/local/bin/lftp

找到问题就好解决了。

在/usr/bin下建一个链接,链至lftp,OK,问题解决。

发表评论?

0 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


Warning: Use of undefined constant XML - assumed 'XML' (this will throw an Error in a future version of PHP) in /opt/wordpress/wp-content/plugins/wp-syntaxhighlighter/wp-syntaxhighlighter.php on line 1048