Pod安装结果到'home':找不到HOME环境 - 扩展`〜'(ArgumentError)

时间:2017-10-19 06:07:34

标签: ios cocoapods xcode9

我正在尝试使用

为我的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>'

这个错误意味着什么,我该如何解决?任何建议赞赏!!

1 个答案:

答案 0 :(得分:0)

  1. 键入命令env以检查HOME路径是否存在。
  2. 如果没有,请移至〜/ .bash_profile并添加: HOME =&#34;用户/#(your_user_name)&#34; export HOME
  3. 输入命令source .bash-profile进行回写。
  4. 这就是我所知道的,希望它能奏效。