MoreLean

ReactNative - pod install 시 `conflicting_dependencies': undefined method `request' for nil:NilClass` 에러 본문

Programmer/React Native

ReactNative - pod install 시 `conflicting_dependencies': undefined method `request' for nil:NilClass` 에러

judeKim' 2024. 1. 10. 23:47
반응형

Notifee 라이브러리를 설치 후 pod install 진행 시 다음과 같은 에러가 발생했다. 

( Notifee에 의한 오류인지는 불명확했다. )

Ignoring ffi-1.16.3 because its extensions are not built. Try: gem pristine ffi --version 1.16.3
/opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/resolver/conflict.rb:47:in `conflicting_dependencies': undefined method `request' for nil:NilClass (NoMethodError)

    [@failed_dep.dependency, @activated.request.dependency]
                                       ^^^^^^^^
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/exceptions.rb:61:in `conflicting_dependencies'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/exceptions.rb:55:in `initialize'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/resolver.rb:193:in `exception'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/resolver.rb:193:in `raise'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/resolver.rb:193:in `rescue in resolve'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/resolver.rb:191:in `resolve'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/request_set.rb:411:in `resolve'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/request_set.rb:423:in `resolve_current'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems.rb:228:in `finish_resolve'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems.rb:285:in `block in activate_bin_path'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems.rb:283:in `synchronize'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems.rb:283:in `activate_bin_path'
        from /opt/homebrew/Cellar/cocoapods/1.14.3/libexec/bin/pod:25:in `<main>'
/opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:317:in `raise_error_unless_state': Unable to satisfy the following requirements: (Gem::Resolver::Molinillo::VersionConflict)

- `minitest (>= 5.1)` required by `activesupport-7.1.2`
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:299:in `block in unwind_for_conflict'
        from <internal:kernel>:90:in `tap'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:297:in `unwind_for_conflict'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:682:in `attempt_to_activate'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:254:in `process_topmost_state'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:182:in `resolve'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/resolver/molinillo/lib/molinillo/resolver.rb:43:in `resolve'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/resolver.rb:190:in `resolve'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/request_set.rb:411:in `resolve'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/request_set.rb:423:in `resolve_current'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems.rb:228:in `finish_resolve'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems.rb:285:in `block in activate_bin_path'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems.rb:283:in `synchronize'
        from /opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems.rb:283:in `activate_bin_path'
        from /opt/homebrew/Cellar/cocoapods/1.14.3/libexec/bin/pod:25:in `<main>'

 

ruby 버전을 체크해 보니 

ruby -v

 

엄청나게 OS 디폴트 버전인 것 같은 2.7.x 버전이 설치되어 있었다. 

현재 ruby 버전 관리는 rvm에 의존하고 있어서 새로운 버전을 설치하기 위해서 

# 목록 업데이트
rvm get stable 

# 설치 가능한 목록 조회 
rvm list known

설치 가능한 버전을 확인해 보니 다음과 같았다. 

그래서 rvm install 3.0.0을 설치하려 했는데, 패키지를 찾을 수 없다고 메시지가 뜨면서도, 설치 과정은 거쳐서 에러가 발생했다. 

그래서 다른 버전들도 설치해 봤지만 모두 동일한 메시지 오류가 발생했다. 

다른 패키지 버전인 rbenv를 설치하고 해 봤지만 동일한 문제가 발생했고, 

결국 asdf로 설치해서 해결했다. 

# asdf 를 설치해주었다. 
# 참고 https://gorails.com/setup/macos/14-sonoma#ruby
cd 
git clone https://github.com/excid3/asdf.git ~/.asdf
echo '. "$HOME/.asdf/asdf.sh"' >> ~/.zshrc
echo '. "$HOME/.asdf/completions/asdf.bash"' >> ~/.zshrc
echo 'legacy_version_file = yes' >> ~/.asdfrc
exec $SHELL

# ruby 3.3.0 설치
asdf plugin add ruby
asdf install ruby 3.3.0
asdf global ruby 3.3.0

# gem update --system
# 하지만 정상적이지 않아서 project 디렉토리에서 프로젝트 ruby 설정을 해주었다. 
asdf local ruby 3.3.0

이후에 pod install 도 정상적으로 동작하는 것을 확인했다. 

 

여담이지만, 티스토리의 맞춤법 기능은 좋지만, 불편하다. 

몇 번의 맞춤법 검사를 돌리고 더 이상 오류가 발생하지 않아야 정상적으로 처리가 된다. 담당자들은 이 상황을 알까?

반응형