Skip to content

Instantly share code, notes, and snippets.

@Pratham82
Created July 15, 2025 18:01
Show Gist options
  • Save Pratham82/88c5bbdd66bda905e0805f74e9e3afbf to your computer and use it in GitHub Desktop.
Save Pratham82/88c5bbdd66bda905e0805f74e9e3afbf to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
echo "πŸ“¦ Cleaning up previous Ruby/CocoaPods setups..."
brew uninstall ruby || true
sudo gem uninstall cocoapods -aIx || true
rm -rf ~/.cocoapods ~/.gem ~/.bundle
echo "πŸ”§ Installing rbenv and ruby-build..."
brew install rbenv ruby-build
echo "πŸ” Initializing rbenv..."
if ! grep -q 'rbenv init' ~/.zshrc; then
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
fi
source ~/.zshrc
echo "πŸ’Ž Installing Ruby 3.2.2..."
rbenv install 3.2.2 || true
rbenv global 3.2.2
echo "πŸ” Verifying Ruby version..."
ruby -v
echo "πŸ“¦ Installing CocoaPods..."
gem install cocoapods
echo "πŸ” Verifying pod version..."
pod --version
echo "βœ… Setup complete! Ruby 3.2.2 and CocoaPods are ready to use in your React Native iOS projects."
echo "➑️ To install pods, run:"
echo " cd ios && pod install"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment