Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

'pod install' crashes on new and existing projects #920

Closed
anagromataf opened this Issue · 16 comments

4 participants

@anagromataf

Report

After getting this error on an existing project, I created a brand new project for a mac app and added a simple Podfile. Running pod install leads to the error shown below. As I'm not into ruby, I don't know where to search for the error.

Stack

   CocoaPods : 0.17.1
        Ruby : ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
    RubyGems : 2.0.3
        Host : Mac OS X 10.8.3 (12D78)
       Xcode : 4.6.1 (4H512)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 578778e6ab8eeaaa73f8c99c0c51a9418662e902

Podfile

workspace 'CocoaPodsTest.xcworkspace'
xcodeproj 'CocoaPodsTest.xcodeproj'

platform :osx, '10.8'

pod 'FMDB', '~> 2.0'

Error

ArgumentError - different prefix: "/" and "."
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb:730:in `relative_path_from'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.1/lib/cocoapods/installer/user_project_integrator.rb:85:in `create_workspace'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.1/lib/cocoapods/installer/user_project_integrator.rb:84:in `map'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.1/lib/cocoapods/installer/user_project_integrator.rb:84:in `create_workspace'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.1/lib/cocoapods/installer/user_project_integrator.rb:62:in `integrate!'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.1/lib/cocoapods/installer.rb:355:in `integrate_user_project'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.1/lib/cocoapods/user_interface.rb:52:in `section'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.1/lib/cocoapods/installer.rb:352:in `integrate_user_project'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.1/lib/cocoapods/installer.rb:87:in `install!'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.1/lib/cocoapods/command/project.rb:40:in `run_install_with_update'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.1/lib/cocoapods/command/project.rb:70:in `run'
/Library/Ruby/Gems/1.8/gems/claide-0.2.0/lib/claide.rb:535:in `run'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.1/lib/cocoapods/command.rb:36:in `run'
/Library/Ruby/Gems/1.8/gems/cocoapods-0.17.1/bin/pod:16
/usr/bin/pod:23:in `load'
/usr/bin/pod:23
@anagromataf

If I don't specify the workspace, it works. Isn't this possible anymore?

@samkrishna

I'm getting the same issue. At first I thought it was because I wasn't explicitly setting multiple targets using the

'target do'
...
'end'

block structure. But even after doing that, it still didn't work.

@samkrishna

Cross-referencing #738

@eholzwarth

I have the same issue. I removed the workspace and the problem disappeared.

@fabiopelosin
Owner

It should be possible to workaround this issue by specifying an absolute path for the workspace.

@samkrishna

Using the "absolute path" workaround doesn't work for me. While it does build the workspace in some fashion, my build targets are hosed and I can't build for either iOS or OSX. It does create the Pod target for each app (along with a separate and explicit 'Pods' target) but it's still unusable for me.

Here's my Podfile:

platform :ios, '6.1'
workspace '/Users/achilles/Projects/MOVED-Tutorials/BNR-MOVED/BNR-MOVED.xcworkspace'
xcodeproj '01.Quiz/Quiz.xcodeproj'

pod 'MAKVONotificationCenter', '~> 0.0.2'

target 'Quiz' do
    platform :ios, '6.1'
    xcodeproj '01.Quiz/Quiz.xcodeproj'
    pod 'MAKVONotificationCenter', '~> 0.0.2'
end

target 'RandomPossessions' do
    platform :osx, '10.8'
    xcodeproj '02.RandomPossessions/RandomPossessions.xcodeproj'
    pod 'MAKVONotificationCenter', '~> 0.0.2'
end
@fabiopelosin
Owner

Can you provide an example project to inspect what is not working?

@eholzwarth

Specifying an absolute path is not portable between different developers environments. Does the fix that you committed convert the relative path to an absolute path internally? If so, that should work.... Can you also please bump the version number for the gemspec?

@fabiopelosin
Owner

@eholzwarth I'm doing some house keeping and I plan to release the fix today. I commented about the workaround to make the life simpler for those who were affected by the bug in the meanwhile.

@samkrishna

@irrationalfab sure. The git repo is here:

git@github.com:samkrishna/MOVED-Tutorials.git
@eholzwarth

@irrationalfab awesome thanks!

@fabiopelosin
Owner

@samkrishna The issue is that CocoaPods doesn't clean up after itself yet (as rarely a project is de-integrated) so there are still references to the old Pods target of your previous attempts. To fix the issues you need to remove from build phases of each target:

  1. The libPods.a from the Link with binary libraries step.
  2. The Copy Pods Resources referencing which runs the Pods-resources.sh script (the other one is needed).

You can also clean up the xcconfig referring to the old target in the project navigator (the one in red) and the reference to the libPods.a file under the Frameworks group.

@samkrishna

That didn't work for me. I've even tried to go as far as delete the entire workspace and rebuild and it still yields the same results. I still get in the iOS project ("01.Quiz") the run target of "My Mac 64-bit" even though Quiz is an iOS target.

@samkrishna

OK -- after fiddling with this a little bit and following @irrationalfab's instructions, it did work. Also, I had to auto-create the schemes and delete the old schemes as well (01.Quiz and 02.RandomPossessions) and remove libPods.a and Copy Pods Resources referencing Pods-resources.sh from each subproject.

@samkrishna

I've also updated the repo's Podfile here in case you wanted to see it, @irrationalfab.

git@github.com:samkrishna/MOVED-Tutorials.git

@fabiopelosin
Owner

@samkrishna Not sure about the issues that you were experiencing but with the changes that I've described it was building on my system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.