今天在安裝nginx時出現如下問題:
執(zhí)行命令
brew install nginx-full --with-rtmp-module
報錯:
cctv-yinyong:~ yinyong$ brew install nginx-full --with-rtmp-module
==> Installing nginx-full from homebrew/nginx
==> Downloading https://nginx.org/download/nginx-1.12.0.tar.gz
Already downloaded: /Users/yinyong/Library/Caches/Homebrew/nginx-full-1.12.0.tar.gz
==> ./configure --prefix=/usr/local/Cellar/nginx-full/1.12.0 --with-http_ssl_mod
==> make install
Last 15 lines from /Users/yinyong/Library/Logs/Homebrew/nginx-full/02.make:
#define ngx_memcmp(s1, s2, n) memcmp((const char *) s1, (const char *) s2, n)
^~
/usr/local/share/rtmp-nginx-module/ngx_rtmp_core_module.c:568:30: error: passing 'ngx_sockaddr_t' to parameter of incompatible type 'const void *'
ngx_memcpy(ls->sockaddr, u.sockaddr, u.socklen);
^~~~~~~~~~
src/core/ngx_string.h:102:54: note: expanded from macro 'ngx_memcpy'
#define ngx_memcpy(dst, src, n) (void) memcpy(dst, src, n)
^~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/secure/_string.h:65:33: note: expanded from macro 'memcpy'
__builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest))
^~~
2 errors generated.
make[1]: *** [objs/addon/rtmp-nginx-module/ngx_rtmp_core_module.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [install] Error 2
READ THIS: http://docs.brew.sh/Troubleshooting.html
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in `parse': Failed to parse JSON response (GitHub::Error)
399: unexpected token at '{
"url": "https://api.github.com/repos/Homebrew/homebr
嘗試連接給定的url尋求幫助http://docs.brew.sh/Troubleshooting.html
之前還有一個鏈接食茎,這里沒顯示棠涮,附上https://github.com/sergey-dryabzhinsky/nginx-rtmp-module/issues/234
解決辦法:
1, 去https://github.com/sergey-dryabzhinsky/nginx-rtmp-module上下載最新的zip萝玷;解壓
2, 將解壓的文件替換掉在/usr/local/share/rtmp-nginx-module/路徑下的文件担汤;
3, 再次在終端中輸入命令brew install nginx-full --with-rtmp-module 問題解決