【问题标题】:lib/pass_server_ctl -s failedlib/pass_server_ctl -s 失败
【发布时间】:2018-05-29 19:56:15
【问题描述】:

我正在尝试设置 Apple Wallet Pass 服务器。我从 Apple 开发者网站下载了 WalletCompanionFiles。我有 xcode 9.3.1 并安装了 xcode 命令行工具。

我执行了以下命令:

$ sudo gem install sinatra sequel sqlite3 rubyzip rack yaml json terminal-table

大部分都成功了,除了我有以下错误:

ERROR:  Could not find a valid gem 'yaml' (>= 0) in any repository
ERROR:  Possible alternatives: zaml, cyaml, faml, haml, maml

然后我输入了下一个命令,但它失败了,我不知道如何解决这个问题:

$ lib/pass_server_ctl -s
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:225:in `open_loop': redirection forbidden: http://jsonip.com -> https://jsonip.com/ (RuntimeError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:151:in `open_uri'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:717:in `open'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:35:in `open'
    from lib/pass_server_ctl:30:in `setup_hostname'
    from lib/pass_server_ctl:228:in `<main>'

【问题讨论】:

    标签: ruby xamarin server wallet


    【解决方案1】:

    yaml 库是 Ruby 标准库的一部分,因此您不需要从 Ruby Gems 安装它。

    看起来 jsonip.com 服务现在正在重定向到 HTTPS URL。我无权访问 WalletCompanionFiles 代码,但我的猜测是在 lib/pass_server_ctl 的某个地方它引用了该 URL,但使用了 HTTP 协议。

    您应该能够将该 URL 替换为 https://jsonip.com/ 并克服 open-uri 错误。

    tl;dr:只需在 lib/pass_server_ctl 的第 30 行将 s 添加到 http 即可

    【讨论】:

      猜你喜欢
      • 2015-06-10
      • 1970-01-01
      • 2022-06-13
      • 2015-02-19
      • 1970-01-01
      • 2018-04-11
      • 2021-11-07
      • 2020-07-28
      • 2019-06-30
      相关资源
      最近更新 更多