본문 바로가기
여러 기록

갑자기 CocoaPods not installed.

by 두 그루 2023. 10. 20.

pub.dev에서 url_luncher를 다운받고 평소와 같이 vscode에서 ios simulator를 실행하고 debug를 실행했더니, 앱은 실행되지 않고 다음과 같은 경고 문구가 떴다.

cocoapods not installed. skipping pod install. cocoapods is used to retrieve the ios and macos platform side's plugin code that responds to your plugin usage on the dart side.

 

the last version of drb (>= 0) to support your ruby & rubygems was 2.0.5. try installing it with `gem install drb -v 2.0.5` and then running the current command again drb requires ruby version >= 2.7.0. the current ruby version is 2.6.10.210.

이제껏 잘 실행되다가 왜 이러는지 알 수는 없었고, 추가 문구에 적혀있는 대로 따라 가보기도 하고 검색해서 해결한 과정을 기록한다.

 

 

하라는 대로 해보기

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

 

CocoaPods Guides

CocoaPods is fully open-sourced, so it depends on community contributions to get better. If you're looking to start working on CocoaPods, this is the place to start.

guides.cocoapods.org

$ sudo gem install cocoapods

 

결과: 다른 거 설치하라고 한다

ERROR:  Error installing cocoapods:
	The last version of drb (>= 0) to support your Ruby & RubyGems was 2.0.5. Try installing it with `gem install drb -v 2.0.5` and then running the current command again
	drb requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210.

 

또 다시 설명대로 drb -v 2.0.5 설치

$ gem install drb -v 2.0.5

 

결과: 권한이 없다고 한다.

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

 

이거 어중간하게 설치했다가 에러를 맞이한 상황이라서 다시 모두 삭제하고 설치 도전

$ sudo gem uninstall cocoapods && sudo gem install cocoapods

 

결과: cocoapods 설치한 적 없다고 한다.

Gem 'cocoapods' is not installed

 

 

검색 통해 해결하기

하라는 대로 해도 되지 않으니 에러문구의 일부분들을 검색해서 해결방법을 찾아다녔다.

 

https://stackoverflow.com/questions/51126403/you-dont-have-write-permissions-for-the-library-ruby-gems-2-3-0-directory-ma

 

You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory. (mac user)

below is what I need to do. To run the specs, you'll need to install RSpec. First, run gem install bundler in the root directory of your project. Then, run bundle install. To run a single spec fil...

stackoverflow.com

$ gem install name_of_gem --user-install

위 코드를 통해 특정 gem을 설치할 수 있다고 한다.

 

$ gem install drb -v 2.0.5 --user-install

 

결과: drb -v 2.0.5 설치 성공

WARNING:  You don't have /Users/(username)/.gem/ruby/2.6.0/bin in your PATH,
	  gem executables will not run.
Successfully installed drb-2.0.5
Parsing documentation for drb-2.0.5
Installing ri documentation for drb-2.0.5
Done installing documentation for drb after 0 seconds
1 gem installed

 

다시 cocoapods 설치 도전했으나, 

$ gem install activesupport -v 6.1.7.6

위를 실행하고 다시 해보라고 한다.

 

결과: 또 권한 없다고 한다.

Fetching activesupport-6.1.7.6.gem
Fetching zeitwerk-2.6.12.gem
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

 

결국 stack overflow에서 알려준 대로 activesupport -v 6.1.7.6 설치를 완료하고, cocoapods까지 설치 완료했다.

$ gem install activesupport -v 6.1.7.6 --user-install
$ sudo gem install cocoapods

 

이제서야 다시 되는 build

댓글