dev._.note

[Error] Error installing cocoapods 본문

Dev/ERROR

[Error] Error installing cocoapods

Laena 2023. 12. 14. 18:53

Error installing cocoapods

터미널에서 cocoapods을 설치하는데 설치가 안되는 문제

 

 

error 문구

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.

 


ruby 버젼이 낮아서 생긴 문제

 

ruby 최신버전으로 설치

brew install rbenv

 

ruby 버전 확인

rbenv install -l

-- 결과
3.0.6
3.1.4
3.2.2
jruby-9.4.5.0
mruby-3.2.0
picoruby-3.0.0
truffleruby-23.1.1
truffleruby+graalvm-23.1.1

 

ruby 최신 버전으로 설치 (오늘자 최신버전 3.2.2)

rbenv install 3.2.2
ruby -v

 

ruby 적용 버전 확인

rbenv versions

* system
  3.1.1
  3.2.2

 

ruby 적용 버전 변경

rbenv global 3.2.2

rbenv versions
  system
  3.1.1
* 3.2.2 (set by /Users/mr/.rbenv/version)

 

+ 추가로 Path설정이 안되서 오류가 난경우

 

error 문구

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

Path 지정

echo '# rbenv' >> ~/.bash_profile 
echo 'export PATH=~/.rbenv/bin:$PATH' >> ~/.bash_profile 
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

 

bash_profile 적용

source ~/.bash_profile

gem 설치

gem install bundler