xcode运行报frameworks.sh: Permission denied问题

本文介绍如何在podfile目录中清除旧的Pods文件和Podfile.lock,通过执行rm-rf Pods/Podfile.lock命令,然后使用pod install命令重新安装Pods,确保项目的依赖项得到更新。

cd 到podfile 目录
终端执行:

rm -rf Pods/ Podfile.lock
pod install
stellaechen@STELLAECHEN-MC1 Python-2.7.13 % make ./python.exe -E -S -m sysconfig --generate-posix-vars ;\ if test $? -ne 0 ; then \ echo "generate-posix-vars failed" ; \ rm -f ./pybuilddir.txt ; \ exit 1 ; \ fi running build running build_ext building &#39;_Qt&#39; extension gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/stellaechen/download/Python-2.7.13/Mac/Include -I. -IInclude -I./Include -I/usr/local/include -I/Users/stellaechen/download/Python-2.7.13/Include -I/Users/stellaechen/download/Python-2.7.13 -c /Users/stellaechen/download/Python-2.7.13/Mac/Modules/qt/_Qtmodule.c -o build/temp.macosx-15.4-arm64-2.7/Users/stellaechen/download/Python-2.7.13/Mac/Modules/qt/_Qtmodule.o -Wno-deprecated-declarations error: unable to open output file &#39;build/temp.macosx-15.4-arm64-2.7/Users/stellaechen/download/Python-2.7.13/Mac/Modules/qt/_Qtmodule.o&#39;: &#39;Operation not permitted&#39; 1 error generated. building &#39;_tkinter&#39; extension gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DWITH_APPINIT=1 -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders -I/System/Library/Frameworks/Tk.framework/Headers -I/System/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders -I/usr/X11R6/include -I/Users/stellaechen/download/Python-2.7.13/Mac/Include -I. -IInclude -I./Include -I/usr/local/include -I/Users/stellaechen/download/Python-2.7.13/Include -I/Users/stellaechen/download/Python-2.7.13 -c /Users/stellaechen/download/Python-2.7.13/Modules/_tkinter.c -o build/temp.macosx-15.4-arm64-2.7/Users/stellaechen/download/Python-2.7.13/Modules/_tkinter.o -framework Tk clang: warning: -framework Tk: &#39;linker&#39; input unused [-Wunused-command-line-argument] In file included from /Users/stellaechen/download/Python-2.7.13/Modules/_tkinter.c:71: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/tk.h:86:11: fatal error: &#39;X11/Xlib.h&#39; file not found 86 | # include <X11/Xlib.h> | ^~~~~~~~~~~~ 1 error generated. building &#39;_ctypes&#39; extension gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I_ctypes/darwin -I/Users/stellaechen/download/Python-2.7.13/Mac/Include -I/Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include -I/Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/powerpc -I. -IInclude -I./Include -I/usr/local/include -I/Users/stellaechen/download/Python-2.7.13/Include -I/Users/stellaechen/download/Python-2.7.13 -c /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/_ctypes.c -o build/temp.macosx-15.4-arm64-2.7/Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/_ctypes.o -DMACOSX In file included from /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/_ctypes.c:113: /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/ffi.h:65:3: error: "Unsupported MacOS X CPU type" 65 | # error "Unsupported MacOS X CPU type" | ^ In file included from /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/_ctypes.c:113: In file included from /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/ffi.h:73: /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/ffitarget.h:12:2: error: "Unsupported CPU type" 12 | #error "Unsupported CPU type" | ^ In file included from /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/_ctypes.c:113: In file included from /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/ffi.h:74: /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/fficonfig.h:51:2: error: "Unknown CPU type" 51 | #error "Unknown CPU type" | ^ In file included from /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/_ctypes.c:113: /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/ffi.h:171:5: error: unknown type name &#39;ffi_abi&#39; 171 | ffi_abi abi; | ^ /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/ffi.h:193:2: error: unknown type name &#39;ffi_sarg&#39; 193 | ffi_sarg sint; | ^ /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/ffi.h:194:2: error: unknown type name &#39;ffi_arg&#39; 194 | ffi_arg uint; | ^ /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/libffi_osx/include/ffi.h:307:11: error: unknown type name &#39;ffi_abi&#39; 307 | ffi_abi abi, | ^ In file included from /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/_ctypes.c:129: /Users/stellaechen/download/Python-2.7.13/Modules/_ctypes/ctypes.h:99:5: error: unknown type name &#39;ffi_closure&#39; 99 | ffi_closure *pcl_write; /* the C callable, writeable */ | ^ 8 errors generated. Python build finished, but the necessary bits to build these modules were not found: _bsddb _curses _curses_panel _sqlite3 _ssl bsddb185 bz2 dbm dl gdbm imageop linuxaudiodev nis ossaudiodev readline spwd sunaudiodev zlib To find the necessary bits, look in setup.py in detect_modules() for the module&#39;s name. Failed to build these modules: _ctypes _Qt _tkinter running build_scripts stellaechen@STELLAECHEN-MC1 Python-2.7.13 % make install /usr/bin/install -c python.exe /usr/local/bin/python2.7 install: /usr/local/bin/INS@20xsco: Permission denied make: *** [altbininstall] Error 71 stellaechen@STELLAECHEN-MC1 Python-2.7.13 %
07-05
### 解决 macOS 上编译 Redis 5.0.14 时遇到的 `Permission denied` 和 `chmod` 错误 在 macOS 上编译 Redis 5.0.14 时,如果执行 `make` 命令时出现 `Permission denied` 错误,并且尝试使用 `chmod +x mkreleasehdr.sh` 时提示 `No such file or directory`,可能是由于以下原因导致: #### 文件权限问题 当执行 `make` 命令时,Redis 的构建过程可能需要对某些脚本(如 `mkreleasehdr.sh`)赋予执行权限。如果这些脚本缺少执行权限,就会触发 `Permission denied` 错误。可以通过以下命令解决此问题[^1]: ```bash chmod +x src/mkreleasehdr.sh ``` 如果仍然提示 `No such file or directory`,则表明目标文件或目录不存在。此时需要检查当前工作目录是否正确,以及是否完整解压了 Redis 源码包。 #### 依赖目录权限不足 Redis 编译过程中会依赖于 `deps` 目录下的子模块(如 `jemalloc`)。如果这些子模块未正确初始化或其文件权限不足,也可能导致类似的错误。可以尝试递归地提升 `deps` 目录及其子目录的权限: ```bash chmod -R 755 deps ``` 此外,确保所有必要的子模块已正确克隆和初始化。如果尚未初始化子模块,可以运行以下命令: ```bash git submodule update --init --recursive ``` #### 环境变量配置不正确 如果系统中未正确设置编译器路径或环境变量,也可能导致 `make` 过程失败。可以显式指定编译器路径以避免此类问题: ```bash export CC=/usr/bin/gcc export CXX=/usr/bin/g++ ``` 同时,确保 `PATH` 环境变量包含 Xcode 命令行工具的路径(如果使用 macOS): ```bash export PATH=/Library/Developer/CommandLineTools/usr/bin:$PATH ``` #### 清理旧的编译缓存 如果之前的编译过程留下了损坏的中间文件,可能会干扰当前的编译过程。可以尝试清理旧的编译缓存并重新开始: ```bash make distclean make ``` #### 完整解决方案示例 以下是完整的解决流程示例: ```bash # 提升脚本执行权限 chmod +x src/mkreleasehdr.sh # 提升依赖目录权限 chmod -R 755 deps # 初始化子模块 git submodule update --init --recursive # 清理旧的编译缓存 make distclean # 重新编译 make ``` --- ###
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值