-
Notifications
You must be signed in to change notification settings - Fork 559
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
doc(ios): install cocoapods with homebrew #1399
doc(ios): install cocoapods with homebrew #1399
Conversation
- cocoapods are not installable with the current system ruby version on macOS. When trying to install with sudo gem install cocoapods, the error message will appear: securerandom requires Ruby version >= 3.1.0. The current ruby version is 2.6.10.210. - On stackoverflow it is suggested to install it instead with homebrew: https://stackoverflow.com/questions/77339560/error-installing-cocoapodsdrb-requires-ruby-version-2-7-0-the-current-ruby
Do we know if CocoaPods manages the Homebrew package, or is it handled by a third party? The current guide follows the steps provided on the official CocoaPods website. In fact, CocoaPods does not recommend using the default macOS system Ruby. Instead, it suggests using a Ruby version manager to install a newer version. For example, the In my case, I have a newer version of Ruby installed on macOS: % ruby -v
ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [arm64-darwin23] Here is their official installation guide, which recommends using a Ruby version manager: |
The homebrew package is maintained by homebrew itself: https://github.com/Homebrew/homebrew-core/blob/447e92edf265af365ed4fd3feb5abcb2d204a956/Formula/c/cocoapods.rb If we use the Cocoapods recommendation I would change the documentation to first load a recent ruby version by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be OK to update the guide to use brew install cocoapods
.
It seems,
- When running
brew install cocoapods
, Homebrew uses a portable version of Ruby.- Requirement for Ruby comes from the
depends_on "ruby"
line in the formula.
- Requirement for Ruby comes from the
- It downloads the CocoaPods tarball from the CocoaPods repository.
- This tarball contains the
cocoapods.gemspec
file, which is then built and installed.
I'm not 100% sure, but if a user had installed Ruby via brew
, would Homebrew use that version instead of the portable version?
At the very least, it seems to ignore the older system's default Ruby, as your PR description suggests its resolved the securerandom requires Ruby version >= 3.1.0. The current ruby version is 2.6.10.210
issue.
I'll wait a bit to see if anyone else has questions or comments. But other than that, I think it's OK to merge.
Cool, thanks for the explanation. I learned a little bit :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with that. Most Mac users should have brew and using it is much more reliable.
sudo gem install cocoapods
, the error message will appear:securerandom requires Ruby version >= 3.1.0. The current ruby version is 2.6.10.210
.Platforms affected
macOS
Motivation and Context
I tried to setup my machine and got an error when installing cocoa pods
Description
Testing
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)