Programing

포드 설치 -bash : 포드 : 명령을 찾을 수 없음

lottogame 2020. 5. 17. 10:26
반응형

포드 설치 -bash : 포드 : 명령을 찾을 수 없음


pod얼마 전에 설치 했습니다. 내가 통해 일하고 있어요, 그래서 그러나, 그것은 작동을 멈췄 다시.

그러나 거의 즉시 문제가 발생합니다.

pod install
-bash: pod: command not found

왜 이런 일이 일어 났습니까?


좋아, 문제를 발견했다. 나는 얼마 전에 루비를 업그레이드했고 많은 보석을 날려 버렸습니다. 해결책:

sudo gem install cocoapods

OS X 10.11에 CocoaPod 설치

이 지침은 모든 베타 및 El Capitan의 최종 릴리스에서 테스트되었습니다.

맞춤 GEM_HOME

위의 오류가 발생하면 해결책입니다.

$ mkdir -p $HOME/Software/ruby
$ export GEM_HOME=$HOME/Software/ruby
$ gem install cocoapods
[...]
1 gem installed
$ export PATH=$PATH:$HOME/Software/ruby/bin
$ pod --version
0.38.2

gem을 설치 한 후 터미널을 다시 시작해야합니다. 또는 간단히 새 탭 터미널을 열어서 수정할 수 있습니다.


이 단계는 올바르게 작동합니다.

포드 설치

[1] 터미널을 열고 다음을 입력하십시오.

sudo gem install cocoapods

보석은 시스템 라이브러리 내부의 Ruby에 설치됩니다. 또는 10.11 Mac OSX El Capitan에서 다음을 입력하십시오.

sudo gem install -n /usr/local/bin cocoapods

"activesupport require Ruby version> = 2.xx"오류가 발생하면 터미널을 입력하여 최신 activesupport를 먼저 설치하십시오.

sudo gem install activesupport -v 4.2.6

[2] 설치 후에는 많은 메시지가 표시되고 읽은 후 오류가 없으면 cocoapods 설치가 완료된 것입니다. 다음으로 cocoapods 마스터 저장소를 설정해야합니다. 터미널에 입력하십시오 :

pod setup

마스터 리포지토리를 다운로드 할 때까지 기다립니다. 크기가 매우 큽니다 (2016 년 12 월의 370.0MB). 그래서 시간이 좀 걸릴 수 있습니다. 활동 및 네트워크 탭으로 이동하여 git-remote-https를 검색하여 다운로드를 추적 할 수 있습니다. 또는 다음과 같이 명령에 자세한 정보를 추가 할 수 있습니다.

pod setup --verbose

[3] 완료되면 "Setup Complete"가 출력되고 XCode 프로젝트를 만들어 저장할 수 있습니다.

[4] 그런 다음 터미널 cd에서 ".xcodeproj 파일이있는 XCode 프로젝트 루트 디렉토리"로 이동 한 후 다음을 입력하십시오.

pod init

[5] 그런 다음 터미널에 입력하여 프로젝트의 podfile을여십시오.

open -a Xcode Podfile

[6] Podfile이 텍스트 모드로 열립니다. 처음에는 몇 가지 기본 명령이 있습니다. 여기에 프로젝트의 종속성을 추가하십시오. 예를 들어, podfile에 다음을 입력하십시오.

/****** These are Third party pods names ******/
pod 'OpenSSL-Universal'
pod 'IQKeyboardManager'
pod 'FTPopOverMenu'
pod 'TYMActivityIndicatorView'
pod 'SCSkypeActivityIndicatorView'
pod 'Google/SignIn'
pod 'UPStackMenu'

(이것은 예를 들어 프로젝트에 라이브러리를 추가하는 예입니다).

Podfile 편집을 마치면 저장하고 XCode를 닫으십시오.

[7] 그런 다음 터미널을 입력하여 프로젝트에 포드를 설치하십시오.

pod install

프로젝트를 위해 podfile에 추가 한 라이브러리 수에 따라이를 완료하는 시간이 다릅니다. 완료되면 다음과 같은 메시지가 나타납니다.

"Pod 설치가 완료되었습니다. Podfile 및 X total pod의 X 종속성이 설치되었습니다."


Ruby 2를 설치하고 시스템 루비 대신 Mountain Lion을 실행하는 것과 동일한 문제가 발생했습니다.

Previously I added PATH=/usr/local/bin:$PATH to my ~/.bash_profile as a way to make sure stuff installed by homebrew, including Ruby 2, took precedence over system-installed binaries.

Anyway, in this case I noticed that cocoapods would install their 'pod' binary not in /usr/local/bin but rather in /usr/local/Cellar/ruby/2.0.0-p247/bin/

So to my .bash_profile I added PATH=$PATH:/usr/local/Cellar/ruby/2.0.0-p247/bin/ and now cocoapods is working like a charm.


Try this:

sudo gem install cocoapods -V

and you must update gem to the newest release using this:

sudo gem update --system 

if you want to enjoy the fast responce :)


In terminal it's better to run installation of the cocoa pods with "sudo". In other case I'm getting an error: "You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory."

So the solution is:

sudo gem install cocoapods

try: rbenv global system and then sudo gem install cocoapods pod setup


For macOS:

brew install cocoapods
brew cask install cocoapods-app

  1. Uninstall all instances of cocopods by this command

    $sudo gem uninstall cocoapods
    
  2. sudo gem install -n /usr/local/bin cocoapods

  3. sudo chmod +rx /usr/local/bin/


Sudo-less installation

If you do not want to grant RubyGems admin privileges for this process, you can tell RubyGems to install into your user directory by passing either the --user-install flag to gem install or by configuring the RubyGems environment. The latter is in our opinion the best solution. To do this, create or edit the .profile file in your home directory and add or amend it to include these lines:

export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH

Note that if you choose to use the --user-install option, you will still have to configure your .profile file to set the PATH or use the command prepended by the full path. You can find out where a gem is installed with gem which cocoapods. E.g.

$ gem install cocoapods --user-install
$ gem which cocoapods
/Users/eloy/.gem/ruby/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods.rb
$ /Users/eloy/.gem/ruby/2.0.0/bin/pod install

Source: https://guides.cocoapods.org/using/getting-started.html


gterzian is on the right track, however, if you later update your version of ruby then you'll also have to update your .profile to point to the new versioned ruby directory. For instance, the current version of ruby is 2.0.0-p353 so you'd have to add /usr/local/Cellar/ruby/2.0.0-p353/bin to your path instead.

A better solution is to add /usr/local/opt/ruby/bin to your PATH. /usr/local/opt/ruby is actually a symlink to the current version of ruby that homebrew automatically updates when you do an upgrade. That way you'll never need to update your PATH and always be pointing to the latest version.


This solution worked for me. Make sure to not miss the last command (export PATH=$PATH:$HOME/Software/ruby/bin).

See This.


If you used homebrew to install ruby, this answer worked for me.

brew unlink ruby && brew link ruby

OSX 10.9.4


@Babul Prabhakar was right

IMPORTANT: However,if you still get "pod: command not found" after using his solution, this command could solve your problem:

sudo chown -R $(whoami):admin /usr/local

it happens to me when I wrote

gem install cocoapods

instead of

sudo gem install cocoapods

if sudo command is not found also, write

export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$PATH

before sudo command


install cocoapods from https://cocoapods.org/app

Commands & versions keep onchanging

so download tar and enjoy


We were using an incompatible version of Ruby inside of Terminal (Mac), but once we used RVM to switch to Ruby 2.1.2, Cocoapods came back.

참고URL : https://stackoverflow.com/questions/14202255/pod-install-bash-pod-command-not-found

반응형