12

when I am using this command to install fastlane in macOS Catalina 10.15:

sudo gem install fastlane -v 2.177.0

or

sudo gem update fastlane

shows this error:

ERROR:  While executing gem ... (NoMethodError)
    undefined method `request' for nil:NilClass
(base)

I tried searching from internet but seems no issue about this problem.what should I do to fix it? This is my ruby version info:

$ ruby -v                                                                                                                                                                      ‹ruby-3.0.0›
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19]
(base)

and this is my rubygem info:

$ gem -v                                                                                                                                                                       ‹ruby-3.0.0›
3.2.3
(base)
Dolphin
  • 29,069
  • 61
  • 260
  • 539
  • 1
    This looks like https://github.com/rubygems/rubygems/issues/4338. To verify, could you please add your Ruby version (`ruby -v`) and Rubygems version (`gem -v`) to your question? – Holger Just Mar 11 '21 at 16:24
  • I have added the ruby version info and gem version info @HolgerJust – Dolphin Mar 12 '21 at 05:24

2 Answers2

19

I tried following steps and issue resolved

gem cleanup
brew uninstall cocoapods
sudo gem uninstall cocoapods
sudo gem install cocoapods -n /usr/local/bin
sudo gem install cocoapods-user-defined-build-types
pod install --repo-update
Isuru Sandamal
  • 426
  • 1
  • 5
  • 10
2

I tried to upgrade the version and works:

gem install cocoapods -v 1.11.3
gem install fastlane -v 2.206.2
Dolphin
  • 29,069
  • 61
  • 260
  • 539