【问题标题】:URLResourceKey.quarantinePropertiesKey is only available on OS X 10.10 or newer when installing chromedriverURLResourceKey.quarantinePropertiesKey 仅在安装 chromedriver 时在 OS X 10.10 或更高版本上可用
【发布时间】:2019-02-08 02:20:38
【问题描述】:

我正在通过brew cask install(参见related issue)下载chromedriver,当我尝试下载它时出现以下错误(粘贴了命令条目的完整输出):

(env) MacBook:project_dir owner$ brew cask install chromedriver
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
dnstwist            grpc                pdns                uftp
firebase-cli        lf                  pdnsrec             wildfly-as
glslviewer          libxlsxwriter       tile38              zabbix

==> Satisfying dependencies
==> Downloading https://chromedriver.storage.googleapis.com/2.41/chromedriver_ma
######################################################################## 100.0%
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/utils/quarantine.swift:29:30: error: 'quarantinePropertiesKey' is only available on OS X 10.10 or newer
      forKey: URLResourceKey.quarantinePropertiesKey
                             ^
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/utils/quarantine.swift:29:30: note: add 'if #available' version check
      forKey: URLResourceKey.quarantinePropertiesKey
                             ^
Error: Failed to quarantine /Users/user/Library/Caches/Homebrew/downloads/42621d77ecaa889fa8ca73ac4b2a2228e3c1d11f20d84c6898e7645397d00f1d--chromedriver_mac64.zip. Here's the reason:
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/utils/quarantine.swift:29:30: error: 'quarantinePropertiesKey' is only available on OS X 10.10 or newer
      forKey: URLResourceKey.quarantinePropertiesKey
                             ^
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/utils/quarantine.swift:29:30: note: add 'if #available' version check
      forKey: URLResourceKey.quarantinePropertiesKey

我目前的macbook规格如下:

以前有人遇到过这个问题吗?任何帮助,将不胜感激。我正在尝试设置无头 chrome 驱动程序但失败了。

UPDATE_EDIT:我已经从 Chrome 移出,并且使用 Firefox 无头浏览器获得了更多的运气,但这仍然无法解决上述问题。

【问题讨论】:

    标签: selenium-chromedriver homebrew homebrew-cask


    【解决方案1】:

    这是由于 Homebrew 中当前存在错误,已合并修复

    每个问题#4809:

    嗨,PR #4656 似乎破坏了 10.11 上的 brew cask install。我在 10.11 上收到错误,但在 10.12 上没有。作为一种解决方法,使用 --no-quarantine 标志重新运行是成功的。我不知道为什么这个 swift 功能不可用,我的操作系统是最新的。

    (截图)

    /usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/utils/quarantine.swift:29:30: error: 'quarantinePropertiesKey' is only available on OS X 10.10 or newer
          forKey: URLResourceKey.quarantinePropertiesKey
    

    (等)

    (剪断等我的)

    这与您面临的问题相同。

    有一个 PR (#4796) 解决了这个问题,它已在一天前(2018-09-06)合并到 master:

    我编写的 Gatekeeper API 依赖于最新的 CLT(或 Xcode)安装,以及用于本地递归的 xattr 的 -r 标志。在某些情况下,Swift 太旧或设置为早于 MacOS 10.10 的部署目标,因此无法使用 URLResourceKey.quarantinePropertiesKey 常量。而且在当前的 Mojave 测试版中,xattr 没有 Apple 的 -r 扩展来进行本地文件系统遍历。

    这个拉取请求在 Swift 脚本中插入了一个额外的检查,即 Quarantine.available? function 和 brew cask doctor,并传播更改以使用 xargs 进行递归。

    我刚刚运行了brew update,它告诉我我正在运行1.7.3,在提交5d894 时运行,这是今天(2018 年9 月7 日)提交的,是homebrew-core 的最新版本写作。

    【讨论】:

    • 感谢您的及时回复!
    【解决方案2】:

    https://github.com/Homebrew/homebrew-cask/issues/51554#issuecomment-418215466

    试试下面。

    $ brew cask install --no-quarantine chromedriver
    

    【讨论】:

    • 嗯,遗憾的是仍然没有运气。 “这里有两个问题。首先,--no-quarantine 标志只是告诉 Homebrew 不要执行隔离过程,如果之前被隔离,它不会(当前)“取消隔离”下载。”因为我在它仍然被隔离之前运行了 brew install 。我想一定有某种缓存可以清除。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-01-22
    • 2016-07-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-09
    相关资源
    最近更新 更多