【问题标题】:Pod install results to `home': couldn't find HOME environment -- expanding `~' (ArgumentError)Pod 安装结果到 `home': 找不到 HOME 环境 -- 扩展 `~' (ArgumentError)
【发布时间】:2018-03-31 03:00:01
【问题描述】:

我正在尝试使用

为我的 iOS 项目安装 pod
pod install

导致如下错误

/usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/lib/cocoapods/config.rb:23:in `home': couldn't find HOME environment -- expanding `~' (ArgumentError)

        from /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/lib/cocoapods/config.rb:23:in `<class:Config>'
        from /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/lib/cocoapods/config.rb:6:in `<module:Pod>'
        from /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/lib/cocoapods/config.rb:3:in `<top (required)>'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/lib/cocoapods.rb:23:in `<module:Pod>'
        from /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/lib/cocoapods.rb:17:in `<top (required)>'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/Cellar/cocoapods/1.3.1/libexec/gems/cocoapods-1.3.1/bin/pod:36:in `<top (required)>'
        from /usr/local/Cellar/cocoapods/1.3.1/libexec/bin/pod:23:in `load'
        from /usr/local/Cellar/cocoapods/1.3.1/libexec/bin/pod:23:in `<main>'

这个错误是什么意思,我该如何解决?任何建议表示赞赏!

【问题讨论】:

    标签: ios cocoapods xcode9


    【解决方案1】:
    1. 输入命令env检查HOME路径是否存在。
    2. 如果没有,移动到~/.bash_profile并添加: HOME = "用户/#(your_user_name)" 导出主页
    3. 键入命令source .bash-profile 回写。

    这就是我所知道的一切,希望它会起作用。

    【讨论】:

      猜你喜欢
      • 2015-02-02
      • 1970-01-01
      • 2013-12-24
      • 2015-06-25
      • 2011-04-01
      • 1970-01-01
      • 2019-06-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多