下面的解决方案解决了一个问题,但又出现了另一个问题:
以下是代码:
exec { "Download Phalcon":
path => ["/usr/bin/", "/home/cphalcon/build"],
command => "git clone git://github.com/phalcon/cphalcon.git /home/cphalcon",
require => [Package["git"], Package["php5-fpm"]]
}
exec { "Build Phalcon":
require => Exec["Download Phalcon"],
command => "./install",
# creates => "/home/cphalcon/build",
cwd => "/home/cphalcon/build",
path => ["/usr/bin", "/home/cphalcon/build"]
}
以下是错误:
==> default: Error: ./install: line 38: rm: command not found
==> default: ./install: line 64: phpize: command not found
==> default: Error: /Stage[main]/Main/Exec[Build Phalcon]/returns: change from notrun to 0 failed: ./install: line 38: rm: command not found
==> default: ./install: line 64: phpize: command not found
有什么想法吗?当我从CLI手动调用./install时,phpize不会丢失 - 为什么它现在会丢失?
答案 0 :(得分:0)
exec
参数在cwd
参数方面不起作用。它设置当前目录,但不允许相对于该目录运行命令。
您还需要设置path
参数(在您的情况下为path => ['/home/cphalcon/build']
)。看看this documentation