Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌈 RuntimeError - Must be in the root of the repo #5039

Closed
1 task done
Coder-256 opened this issue Mar 16, 2016 · 11 comments · Fixed by CocoaPods/Core#317
Closed
1 task done

🌈 RuntimeError - Must be in the root of the repo #5039

Coder-256 opened this issue Mar 16, 2016 · 11 comments · Fixed by CocoaPods/Core#317
Labels
d1:easy An easy ticket that is a good start for first-time contributors s3:detailed Issues with in-depth explanations and examples that make it easier to troubleshoot t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!

Comments

@Coder-256
Copy link

Report

What did you do?

I ran pod update.

What did you expected to happen?

I expected all pods to be upgraded.

What happened instead?

CocoaPods quit with an error.

Stack

   CocoaPods : 1.0.0.beta.6
        Ruby : ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
    RubyGems : 2.5.1
        Host : Mac OS X 10.11.3 (15D21)
       Xcode : 7.2.1 (7C1002)
         Git : git version 2.7.2
Ruby lib dir : /usr/local/Cellar/ruby/2.3.0/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 80d924a73e40a484acde3a6d53406d56e3eb75bc

Plugins

cocoapods-deintegrate : 1.0.0.beta.1
cocoapods-plugins     : 1.0.0.beta.1
cocoapods-search      : 1.0.0.beta.1
cocoapods-stats       : 1.0.0.beta.3
cocoapods-trunk       : 1.0.0.beta.2
cocoapods-try         : 1.0.0.beta.3

Podfile

platform :osx, '10.11'

use_frameworks!

target "-redacted-" do
  pod 'PureLayout', "~> 3.0"
  pod "GBCli", "~> 1.1"
end

Error

RuntimeError - Must be in the root of the repo
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.0.0.beta.6/lib/cocoapods-core/source.rb:330:in `ensure_in_repo!'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.0.0.beta.6/lib/cocoapods-core/source.rb:371:in `git_commit_hash'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.0.0.beta.6/lib/cocoapods-core/master_source.rb:31:in `block in requires_update?'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.0.0.beta.6/lib/cocoapods-core/master_source.rb:31:in `chdir'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.0.0.beta.6/lib/cocoapods-core/master_source.rb:31:in `requires_update?'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.0.0.beta.6/lib/cocoapods-core/master_source.rb:14:in `update'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0.beta.6/lib/cocoapods/sources_manager.rb:328:in `block (2 levels) in update'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0.beta.6/lib/cocoapods/user_interface.rb:63:in `section'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0.beta.6/lib/cocoapods/sources_manager.rb:327:in `block in update'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0.beta.6/lib/cocoapods/sources_manager.rb:326:in `each'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0.beta.6/lib/cocoapods/sources_manager.rb:326:in `update'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0.beta.6/lib/cocoapods/installer/analyzer.rb:220:in `block in update_repositories'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0.beta.6/lib/cocoapods/installer/analyzer.rb:218:in `each'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0.beta.6/lib/cocoapods/installer/analyzer.rb:218:in `update_repositories'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0.beta.6/lib/cocoapods/installer.rb:147:in `block in resolve_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0.beta.6/lib/cocoapods/user_interface.rb:63:in `section'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0.beta.6/lib/cocoapods/installer.rb:146:in `resolve_dependencies'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0.beta.6/lib/cocoapods/installer.rb:114:in `install!'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0.beta.6/lib/cocoapods/command/update.rb:60:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/claide-1.0.0.beta.3/lib/claide/command.rb:334:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0.beta.6/lib/cocoapods/command.rb:50:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0.beta.6/bin/pod:44:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
@Coder-256 Coder-256 reopened this Mar 16, 2016
@Coder-256
Copy link
Author

Didn't mean to close.

@segiddins
Copy link
Member

You don't have symlinks anywhere by any chance, do you?

@Coder-256
Copy link
Author

Still having this issue:


Command

/usr/local/bin/pod repo update

Report

  • What did you do?
    Ran the command.
  • What did you expect to happen?
    My repo to be updated.
  • What happened instead?
    This error.

Stack

   CocoaPods : 1.0.0
        Ruby : ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
    RubyGems : 2.6.2
        Host : Mac OS X 10.11.4 (15E65)
       Xcode : 7.3.1 (7D1014)
         Git : git version 2.2.1
Ruby lib dir : /usr/local/Cellar/ruby/2.3.0/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 79a7883ab0a9ffb35a56ee7e8043a3a5b24f998d

Plugins

cocoapods-deintegrate : 1.0.0
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.0.0
cocoapods-try         : 1.0.0

Podfile

use_frameworks!
platform :osx, '10.11'

target '<redacted>' do
 pod 'Alamofire', '~> 3.4'
end

Error

Pod::StandardError - Must be in the root of the repo (/Users/<redacted>/.cocoapods/repos/master), instead in /Users/<redacted>/.cocoapods/repos/master.
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.0.0/lib/cocoapods-core/source.rb:403:in `ensure_in_repo!'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.0.0/lib/cocoapods-core/source.rb:431:in `git_commit_hash'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.0.0/lib/cocoapods-core/master_source.rb:31:in `block in requires_update?'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.0.0/lib/cocoapods-core/master_source.rb:31:in `chdir'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.0.0/lib/cocoapods-core/master_source.rb:31:in `requires_update?'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-core-1.0.0/lib/cocoapods-core/master_source.rb:14:in `update'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0/lib/cocoapods/sources_manager.rb:87:in `block (2 levels) in update'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0/lib/cocoapods/user_interface.rb:63:in `section'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0/lib/cocoapods/sources_manager.rb:86:in `block in update'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0/lib/cocoapods/sources_manager.rb:85:in `each'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0/lib/cocoapods/sources_manager.rb:85:in `update'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0/lib/cocoapods/command/repo/update.rb:23:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/claide-1.0.0/lib/claide/command.rb:334:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0/lib/cocoapods/command.rb:50:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/cocoapods-1.0.0/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'

@segiddins
Copy link
Member

segiddins commented May 12, 2016

@Coder-256 are you on a case-sensitive file system per chance? (Those two paths look identical to me)

@Coder-256
Copy link
Author

@segiddins Wait, hold on. Just modified source.rb locally:

raise StandardError, "Oh no. Repo: #{repo}, Pathname.pwd: #{Pathname.pwd}, realpath (respectively) #{repo.realpath} and #{Pathname.pwd}."

And got:

Pod::StandardError - Oh no. Repo: /Users/j.../.cocoapods/repos/master, Pathname.pwd: /Users/J.../.cocoapods/repos/master, realpath (respectively) /Users/j.../.cocoapods/repos/master and /Users/J.../.cocoapods/repos/master.

The ... is the rest of my username. It definitely has to do with case sensitivity.

@segiddins
Copy link
Member

Is your file system case sensitive or insensitive?

@Coder-256
Copy link
Author

@segiddins I am not on a case-sensitive FS, which is exactly the problem – you are changing directories to the capitalized version, but looking for the non capitalized version!

The easiest fix would be to simply convert all paths to lowercase for the sake of conversion, but a better solution would be to check to see if the FS is case sensitive (no idea how you could do that).

@segiddins
Copy link
Member

Answer is probably to compare the two paths with File.identical?, after having looked at the docs. If you'd like to make a PR for that, it'd be much appreciated!

@segiddins segiddins reopened this May 12, 2016
@segiddins segiddins added t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome! d1:easy An easy ticket that is a good start for first-time contributors s3:detailed Issues with in-depth explanations and examples that make it easier to troubleshoot and removed s1:awaiting input Waiting for input from the original author labels May 12, 2016
@Coder-256
Copy link
Author

This works!:

def ensure_in_repo!
  return if Pathname.pwd.realpath.to_s.downcase == repo.realpath.to_s.downcase
  raise StandardError, "Must be in the root of the repo (#{repo}), " \
    "instead in #{Pathname.pwd}."
end

@amirpervaiz086
Copy link

amirpervaiz086 commented Sep 22, 2016

@segiddins I am having issue in Xcode 8 with "Use Legacy Swift Language Version...". I tried #1526 but nothing worked. I even updated my pods to 1.1.0.rc.2 but still having this error. Adding commands to end of pod file still same issue. Can you tell me what could be issue?

@benasher44
Copy link
Member

@amirpervaiz086 the original issue you filed should be fixed in the latest 1.1.0 release, which it appears you're using. Can you file a new issue and fill out the issue template for the new issue you're experiencing? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d1:easy An easy ticket that is a good start for first-time contributors s3:detailed Issues with in-depth explanations and examples that make it easier to troubleshoot t2:defect These are known bugs. The issue should also contain steps to reproduce. PRs welcome!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants