在Ionic项目中安装Pod(iOS平台)

时间:2017-06-29 12:44:15

标签: ios cordova ionic-framework cocoapods

命令

/usr/local/bin/pod install

报告

  • 你做了什么?

我在离子生成的iOS项目中使用命令“pod install”。我知道这个问题是因为创建iOS平台我不得不使用“sudo”,现在它受到了保护,但我没有其他办法添加iOS平台,没有“sudo”它会让我再次出现与Cordova权限的错误文件。

  • 你期望发生什么?

我只是希望安装Pod,因为我需要安装OneSignal框架。

  • 反而发生了什么?

权限问题。

堆栈

CocoaPods : 1.2.1 Ruby : ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16] RubyGems : 2.0.14.1 Host : Mac OS X 10.12.5 (16F73) Xcode : 8.3.3 (8E3004b) Git : git version 2.11.0 (Apple Git-81) Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib Repositories : master - https://github.com/CocoaPods/Specs.git @ 41b515530ae13b6eb0bf18252ba1b05f515afbe6

插件

cocoapods-deintegrate : 1.0.1 cocoapods-plugins : 1.0.0 cocoapods-search : 1.0.0 cocoapods-stats : 1.0.0 cocoapods-trunk : 1.2.0 cocoapods-try : 1.1.0

Podfile

```红宝石

不要修改 - 由Apache Cordova自动生成

平台:ios,'8.0' 目标'Palabra deVidaEspaña'做     项目'Palabra deVidaEspaña.xcodeproj'     pod'OneSignal','2.5.4' 结束 ```

错误

Errno::EACCES - Permission denied - /Users/oriollopezperez/Documents/wolspain-app/platforms/ios/Pods /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `mkdir' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `fu_mkdir' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:219:in `block (2 levels) in mkdir_p' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in `reverse_each' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in `block in mkdir_p' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in `each' /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in `mkdir_p' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/sandbox.rb:58:in `initialize' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/config.rb:184:in `new' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/config.rb:184:in `sandbox' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/command.rb:138:in `installer_for_config' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/command/install.rb:38:in `run' /Library/Ruby/Gems/2.0.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/lib/cocoapods/command.rb:52:in `run' /Library/Ruby/Gems/2.0.0/gems/cocoapods-1.2.1/bin/pod:55:in `<top (required)>' /usr/local/bin/pod:23:in `load' /usr/local/bin/pod:23:in `<main>'

1 个答案:

答案 0 :(得分:0)

安装并更新cocoapods以解决问题

sudo gem install cocoapods