安装特定的CocoaPod - '没有这样的文件'同时处理预安装钩子

时间:2014-02-19 13:55:49

标签: cocoapods

我使用CocoaPods在Mac OS X 10.9.1上安装了MapBox,但我遇到了链接问题,MapBox人员建议我直接从他们的存档中的标签下载。不幸的是,我无法加载该标记。

这是我的Podfile及其建议:

platform :ios, '7.0'
pod 'AFNetworking', '~> 2.0'
pod 'Mapbox', :git => 'https://github.com/mapbox/mapbox-ios-sdk', :tag => '1.1.0'
pod 'TWTSideMenuViewController', '~> 0.3'

CocoaPods在pod“Mapbox”行上出现错误(见下文)。它似乎无法找到该目录。我试过了:

  • 获取特定内容:提交以查看是否为该标记(否)
  • 将目录名称更改为仅包含字母字符(没有帮助)
  • 更改Pod目录以允许所有人写入(没有帮助)
  • 用sudo gem卸载cocoapods重新安装CocoaPods,sudo gem install cocoapods(我再次获得0.29.0,但没有帮助获取标记源)

为什么预安装挂钩无法找到(或创建?)该目录?

以下是“pod install”的输出:

[!] An error occurred while processing the pre-install hook of Mapbox (1.1.0).

No such file or directory - /Users/Bob/Documents/InfoBridge/projects/infobridge_aboutmywoods-ios/Pods/Mapbox

/Users/Bob/Documents/InfoBridge/projects/infobridge_aboutmywoods-ios/Pods/Local Podspecs/Mapbox.podspec:25:in `chdir'
/Users/Bob/Documents/InfoBridge/projects/infobridge_aboutmywoods-ios/Pods/Local Podspecs/Mapbox.podspec:25:in `block (2 levels) in _eval_podspec'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.29.0/lib/cocoapods-core/specification.rb:406:in `call'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.29.0/lib/cocoapods-core/specification.rb:406:in `pre_install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:489:in `run_spec_pre_install_hook'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:464:in `block (3 levels) in run_pre_install_hooks'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:462:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:462:in `block (2 levels) in run_pre_install_hooks'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:460:in `each'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:460:in `block in run_pre_install_hooks'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/user_interface.rb:113:in `message'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:459:in `run_pre_install_hooks'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:104:in `block in download_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/user_interface.rb:52:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:101:in `download_dependencies'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/installer.rb:87:in `install!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/command/project.rb:38:in `run_install_with_update'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/command/project.rb:68:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-0.4.0/lib/claide/command.rb:213:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/command.rb:51:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/bin/pod:24:in `<top (required)>'
/usr/bin/pod:23:in `load'
/usr/bin/pod:23:in `<main>'

谢谢,鲍勃

2 个答案:

答案 0 :(得分:2)

如果您以前安装了Mapbox,请先将其卸载。然后重新安装。

  1. 在Podfile中删除或注释此行 pod 'MapBox', '~> 1.1.0'
  2. 运行命令 pod install 这将删除Mapbox及其所有依赖项。

  3. 将Mapbox放回Podfile pod 'Mapbox', :git => 'https://github.com/mapbox/mapbox-ios-sdk.git', :branch => 'develop'

  4. 再次运行pod install
  5. 在我的案例中它有所帮助

答案 1 :(得分:0)

删除podFile.lock,问题解决了。