Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 从脚本运行时未找到GCC_Macos_Bash_Gcc_Nginx - Fatal编程技术网

Macos 从脚本运行时未找到GCC

Macos 从脚本运行时未找到GCC,macos,bash,gcc,nginx,Macos,Bash,Gcc,Nginx,我正在尝试创建一个脚本,以便在OS X上获取和编译nginx。当我从终端运行/configure--prefix=。时,我得到了您所期望的结果,但当我将其放入bash脚本时,我得到: checking for OS + Darwin 13.0.0 x86_64 checking for C compiler ... not found ./configure: error: C compiler cc is not found make: *** No rule to make targe

我正在尝试创建一个脚本,以便在OS X上获取和编译nginx。当我从终端运行
/configure--prefix=。
时,我得到了您所期望的结果,但当我将其放入bash脚本时,我得到:

checking for OS
 + Darwin 13.0.0 x86_64
checking for C compiler ... not found

./configure: error: C compiler cc is not found

make: *** No rule to make target `build', needed by `default'.  Stop.
关于GCC丢失的原因有什么想法吗

  • 检查cc的完整路径(执行哪个cc)
  • 扩展脚本中的路径(例如
    path=$path:/usr/bin

  • 哪个cc
    给了我
    /usr/bin/cc
    ,我可以从我的脚本中回显路径,它给了我
    /usr/bin:/usr/sbin:/sbin:/usr/local/bin
    也从脚本中运行
    pwd
    ,并使其与交互路径相同。显然,这是一个版本问题,没有给我任何有用的错误数据。感谢您的帮助。请搜索您的错误消息
    错误:C编译器cc未找到
    ,还有几篇关于同一问题的帖子,其中一个解决方案可能会有所帮助。我所说的搜索SO是指
    google
    以及查询中的
    stackoverflow.com