【问题标题】:Xcode 5.1 unable to find utility "make", not a developer tool or in PATHXcode 5.1 无法找到实用程序“make”,而不是开发人员工具或 PATH
【发布时间】:2014-07-13 05:19:28
【问题描述】:

我正在尝试关注these directions 来安装 Google Protocol Buffers。创建脚本后,我尝试使用以下命令运行它:

$ ./build-proto-ios.sh

我收到以下输出:

mkdir: ios-build: File exists
Platform is iPhoneSimulator
./build-proto-ios.sh: line 40: ./configure: No such file or directory
make: error: unable to find utility "make", not a developer tool or in PATH
make: error: unable to find utility "make", not a developer tool or in PATH
cp: src/.libs/libprotobuf-lite.a: No such file or directory
Platform is iPhoneOS
./build-proto-ios.sh: line 40: ./configure: No such file or directory
make: error: unable to find utility "make", not a developer tool or in PATH
make: error: unable to find utility "make", not a developer tool or in PATH
cp: src/.libs/libprotobuf-lite.a: No such file or directory
Platform is iPhoneOS
./build-proto-ios.sh: line 40: ./configure: No such file or directory
make: error: unable to find utility "make", not a developer tool or in PATH
make: error: unable to find utility "make", not a developer tool or in PATH
cp: src/.libs/libprotobuf-lite.a: No such file or directory
make: error: unable to find utility "make", not a developer tool or in PATH
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: ios-build/libprotobuf-lite-armv7.a (No such file or directory)

所以,我查找了以下信息:

无法找到实用程序“make”,而不是开发人员工具或在 PATH 中

我发现 this information 用于安装 Xcode 命令行工具,因为我认为这可能是原因。但即使在为 OS X Mavericks 安装了最新的命令行工具后,我仍然会收到此错误。

有什么想法吗?

【问题讨论】:

  • 在你的 shell 提示符下,尝试which make
  • 这两个都试过了。它在 PATH 中
  • /usr/bin/make 只是一个转发器,它在 quellish 的答案中转发到路径上的 make。确保您有权访问该路径。试试他的xcrun make 看看会产生什么,我猜它不会起作用,但也许 :) 您看到的错误消息是转发器找不到合适的真正二进制文件来使用。跨度>

标签: ios command-line protocol-buffers


【解决方案1】:

1) xcode-select -p -> /Applications/Xcode.app/Contents/Developer

2) sudo xcode-select --switch /Library/Developer/CommandLineTools

3) xcode-select -p -> /Library/Developer/CommandLineTools

4) eval "$(rbenv init -)"

5) rbenv 安装 2.5.3

6) rbenv 本地 2.5.3

另外,请注意 xcode 是否已正确更新

【讨论】:

    【解决方案2】:

    看起来这不是您的实际问题。当脚本运行时,它会在 iOS 6 文件夹中查找包含的 make...这可能不存在。

    查看https://gist.github.com/PR3x/0fde040902ed4e9a1a61 的脚本,该脚本将为您构建 protobuf 作为胖库。只需将它放在一个新文件夹中,chmod +x,然后运行。 (基于https://stackoverflow.com/a/19582682/939927

    需要注意的一点是,您需要将所有生成的 .pb.* 文件更改为使用 ::google_public: 命名空间而不是 ::google:,因为 Apple 在内部使用它。

    另外需要注意的是,这只适用于 32 位 ARM 和模拟器。 64 位 ARM (iPhone 5s) 尚未构建。

    祝你好运!

    【讨论】:

    • 为了以后找到这个答案的人:在1720 行的脚本中,将SDK 更改为您正在使用的任何/任何一个。
    【解决方案3】:

    Make 包含在 Xcode 中。您无需安装命令行工具即可使用它。它位于 Xcode 应用程序中:

    /Applications/Xcode.app/Contents/Developer/usr/bin/make

    并且可以使用xcrun访问。

    xcrun make

    如果由于某种原因未设置活动开发者目录或不正确,这仍然会失败。例如,如果您移动了 Xcode,就会发生这种情况。

    使用xcode-select设置它

    sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

    检查您是否可以在命令行会话中使用这些方法访问 make。如果可以的话,原型缓冲区构建脚本可能是问题所在。

    【讨论】:

    • 他看到的消息实际上是由xcrun产生的,所以我猜这不会解决他的问题。
    • 那个 shell 脚本乱七八糟的环境,看起来它不是从正确的位置运行的。
    • 是的,如果在非标准环境中使用 xcrun 可能会很脆弱。
    猜你喜欢
    • 1970-01-01
    • 2019-05-09
    • 2020-08-13
    • 1970-01-01
    • 2014-04-18
    • 1970-01-01
    • 2017-08-21
    • 2020-06-07
    • 1970-01-01
    相关资源
    最近更新 更多