Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't download Cocoapods #12327

Open
elroi8 opened this issue Mar 26, 2024 · 5 comments
Open

can't download Cocoapods #12327

elroi8 opened this issue Mar 26, 2024 · 5 comments

Comments

@elroi8
Copy link

elroi8 commented Mar 26, 2024

Part of the work for my project I need to install cocoapods
Unfortunately, I run into a problem that every time I put in the terminal the command - "sudo gem install cocoapods"
" and pressing the password nothing happens after that

I have a Mac computer with the newest version of iOS. I have tried until now to solve it by forums on the Internet, Apple's support center, and with the help of chatGPT, but nothing helped.

please help me

@monfresh
Copy link

Hi @elroi8. I don't recommend using sudo to install Cocoapods. The most reliable way to install Cocoapods on a Mac is to set up a proper Ruby development environment that uses a version manager to install a separate version of Ruby that doesn't interfere with the one that came preinstalled on your Mac. Once you have that, you'll be able to install cocoapods with gem install cocoapods.

Here's a very detailed step-by-step guide for installing Ruby on a Mac.

@elroi8
Copy link
Author

elroi8 commented Mar 26, 2024

@monfresh
I did the guide and this is the message I got-

elroiadmin@lrwys-MacBook-Air ~ % gem install cocoapods

ERROR: Error installing cocoapods:
The last version of activesupport (>= 5.0, < 8) to support your Ruby & RubyGems was 6.1.7.7. Try installing it with gem install activesupport -v 6.1.7.7 and then running the current command again
activesupport requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210.
elroiadmin@lrwys-MacBook-Air ~ % x

@monfresh
Copy link

@elroi8 Make sure you follow the entire guide and don't skip any steps. You're still using the system Ruby because it says "The current ruby version is 2.6.10.210."

If you followed the guide carefully, when you quit and relaunch your terminal, if you run ruby -v, it should say 3.3.0. If not, try switching manually like this:

chruby 3.3.0

Then run ruby -v to confirm that you're using version 3.3.0.

I also recommend carefully reading the sections called How to install different versions of Ruby and switch between them and Recommended way to automatically switch to the correct version.

@MANIKANDAN1709
Copy link

I Also faced the same issue I am currently using the macOS 14.4.1 (23E224) version and ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin23] which comes by default with MacOS.When I try to install Cocopods using both the sudo and sudo-less methods, the installation fails due to some dependencies of Cocopods that require the higher version.So I upgraded the Ruby version with the help of rbenv and solved the issue.

Step 1: install rbenv using Home Brew.

brew install rbenv ruby-build

Step 2: Setting PATH for rbenv in ~/.zshrc

#Setting PATH for rbenv
eval "$(rbenv init - zsh)"

Step 3 : Set the default Ruby version for this machine
rbenv global 3.1.2:

Step 4: Restart the terminal, check the ruby version and install Cocopods.

@elroi8
Copy link
Author

elroi8 commented Apr 8, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants