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

1.14.0 - requires new Ruby 2.7.4 #12122

Closed
khoogheem opened this issue Oct 27, 2023 · 18 comments
Closed

1.14.0 - requires new Ruby 2.7.4 #12122

khoogheem opened this issue Oct 27, 2023 · 18 comments
Labels
s2:confirmed Issues that have been confirmed by a CocoaPods contributor

Comments

@khoogheem
Copy link

khoogheem commented Oct 27, 2023

with 1.14.0 it won't install on Sonoma or other version of Mac as it requires Ruby 2.7.4 which is not part of the release notes

Would be nice be able to continue to use the standard setup on MacOS vs having to update all devices such as developers devices, build servers, etc..

@saldous
Copy link

saldous commented Oct 27, 2023

I have the same issue, I just tried to update Cocoapods today and now it doesn't work: sudo gem install cocoapods

Fetching cocoapods-core-1.14.2.gem
Fetching cocoapods-downloader-2.0.gem
Fetching cocoapods-1.14.2.gem
ERROR:  Error installing cocoapods:
	**There are no versions of cocoapods-downloader (>= 2.0) compatible with your Ruby & RubyGems. Maybe try installing an older version of the gem you're looking for?
	cocoapods-downloader requires Ruby version >= 2.7.4. The current ruby version is 2.6.10.210.**

@gokhanseckn
Copy link

I'm also having the same issue. I can't install Cocoapods on Sonoma.

@sudhakar-varma
Copy link

Facing same issue. I can't install Cocoapods on Sonoma.

@masterwok
Copy link

masterwok commented Oct 29, 2023

I also just ran into this issue after upgarding to Sonoma.

I'm trying to update cocoapods so I can resolve the following [issue](#12012):

error: DT_TOOLCHAIN_DIR cannot be used to evaluate LD_RUNPATH_SEARCH_PATHS, use TOOLCHAIN_DIR instead (in target 'Pods-Runner' from project 'Pods')
error: DT_TOOLCHAIN_DIR cannot be used to evaluate LD_RUNPATH_SEARCH_PATHS, use TOOLCHAIN_DIR instead (in target 'Runner' from project 'Runner')
error: DT_TOOLCHAIN_DIR cannot be used to evaluate LD_RUNPATH_SEARCH_PATHS, use TOOLCHAIN_DIR instead (in target 'Flutter Assemble' from project 'Runner')
error: DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead (in target 'Flutter Assemble' from project 'Runner')

Below is the output from attempting to upgrade on macOS 14.1:

> sudo gem install cocoapods
ERROR:  Error installing cocoapods:
        There are no versions of cocoapods-downloader (>= 2.0) compatible with your Ruby & RubyGems. Maybe try installing an older version of the gem you're looking for?
        cocoapods-downloader requires Ruby version >= 2.7.4. The current ruby version is 2.6.10.210.
> ruby --version
ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin23]
> brew install ruby
Warning: ruby 3.2.2_1 is already installed and up-to-date.
To reinstall 3.2.2_1, run:
  brew reinstall ruby

Using homebrew to upgrade appears to work and maybe this is a path issue but I'm still seeing version 1.12.1 when I run pods --version:

> brew reinstall cocoapods
Warning: Treating cocoapods as a formula. For the cask, use homebrew/cask/cocoapods
==> Downloading https://ghcr.io/v2/homebrew/core/cocoapods/manifests/1.14.2
Already downloaded: /Users/jonathantrowbridge/Library/Caches/Homebrew/downloads/ffdb8f03f836b490890adc2317a64fa945cad4287e64c38941c6d714b95e5036--cocoapods-1.14.2.bottle_manifest.json
==> Fetching cocoapods
==> Downloading https://ghcr.io/v2/homebrew/core/cocoapods/blobs/sha256:3d97509030c7fe205db528e8a721779f996baee9178e648b5d896cca28de85bf
Already downloaded: /Users/jonathantrowbridge/Library/Caches/Homebrew/downloads/d285676aef647a0adc7187c9b97059b5e6fd815de0cdcc9074a3adfe0e05b19c--cocoapods--1.14.2.arm64_sonoma.bottle.tar.gz
==> Reinstalling cocoapods 
==> Pouring cocoapods--1.14.2.arm64_sonoma.bottle.tar.gz
🍺  /opt/homebrew/Cellar/cocoapods/1.14.2: 13,781 files, 28.9MB
==> Running `brew cleanup cocoapods`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

> pods --version
1.12.1

EDIT (SOLUTION):

I was able to upgrade to cocoapods version 1.14.1 by doing the following:

gem uninstall cocoapods

# Might need to use brew install here if you already have cocoapods installed via homebrew
brew reinstall cocoapods

# Open a new terminal and check version
pod --version

@MinhLuongNeo
Copy link

You just need to install the older pod version:
sudo gem install cocoapods -v 1.13.0

Bonus:
You may also need to unistall cocoapod before reinstalling:
sudo gem uninstall cocoapods

@masterwok
Copy link

@MinhLuongNeo why use an older pod version since updating to latest resolves the issue and is possible on Sonoma?

@saldous
Copy link

saldous commented Oct 30, 2023

Why was the requirement changed and not documented?

@sochalewski
Copy link

sochalewski commented Nov 4, 2023

According to the official guides CocoaPods (…) will be installable with the default Ruby available on macOS. You can use a Ruby Version manager, however we recommend that you use the standard Ruby available on macOS (…). Unfortunately it's no longer true since 1.14.0. I hope this will be fixed in the future.

cc @amorde @dnkoutso to draw attention 🙏

@saldous
Copy link

saldous commented Nov 13, 2023

When will you fix this??

@monfresh
Copy link

Unfortunately, the official advice to install cocoapods with sudo using the default Ruby available on macOS is not the best practice recommended by the Ruby community. It is much safer and more reliable to install a separate version of Ruby using a Ruby installation tool/version manager such as ruby-install, rbenv, asdf, or rvm. Here are a few articles that explain why using the system Ruby is a bad idea:

https://www.moncefbelyamani.com/why-you-shouldn-t-use-the-system-ruby-to-install-gems-on-a-mac/ (mine)
https://dontusesystemruby.com/#/ (not mine)

The version of Ruby that comes with macOS is 2.6.10, which reached end of life almost 2 years ago. I'm not speaking for the Cocoapods team, but it's perfectly reasonable for them to stop supporting such old versions. Even Ruby 2.7 reached end of life earlier this year. However, I agree that the fact that this breaking change is not documented in the Cocoapods changelog or in the cocoapods-downloader changelog is not great.

Also, it's not guaranteed that Apple will continue to preinstall Ruby on macOS. A while back, they said that they might stop preinstalling certain scripting languages, and they removed Python in Monterey (macOS 12.3).

So, I highly recommend that people learn how to use a Ruby version manager. My personal preference is chruby with ruby-install, and I've written a step-by-step guide for installing Ruby on a Mac. I hope it helps!

@saldous
Copy link

saldous commented Nov 15, 2023

@monfresh
I tried following the guide, it's incredible complicated and involved... and I got all the way through ok and at the end I still get errors. and Ruby on Mac app is incredibly expensive for a solo dev. After installing following the guide, quit terminal, set it back to run in Rosetta, then re-open and things should work then (that part is missing in the guide)

Cocoapods team that introduced this breaking change and didn't document it needs a slap on the wrist and to fix it back to the default MacOS Ruby version, as per their docs, and better plan for such a change in the future.

😡😡😡
cc @amorde @dnkoutso to draw attention 🙏

@amorde
Copy link
Member

amorde commented Nov 16, 2023

Hey folks - apologies for the mishap here. I thought the last few releases of macOS were on 2.7 but apparently even macOS Sonoma still only includes 2.6.

I was rushing to release 1.14 so that we could ship the fix for #12081 and was having issues supporting both newer versions of Ruby & external dependencies and the older 2.6 Ruby versions. At the time it was blocking me from releasing. There's a chance I could figure out a path to re-adding 2.6, but for now I've updated the release notes of 1.14.0 to include a note about dropping support for 2.6.

As @monfresh mentioned, even 2.7.4 is EOL. Supporting older versions along with newer versions of Ruby can be quite challenging when external dependencies have specific Ruby version requirements.

Cocoapods team that introduced this breaking change and didn't document it needs a slap on the wrist and to fix it back to the default MacOS Ruby version, as per their docs, and better plan for such a change in the future.

Respectful reminder that we do this in our free time and have full time jobs. CocoaPods is receiving very little contributions at the moment, and all of our time is going into keeping the lights on so people relying on it can still use it. If you rely on CocoaPods perhaps it would be worth investing some time into making your dev setup more robust by decoupling yourself from system ruby and using bundler so you don't need to wait for a specific CocoaPods release to pull in a bug fix.

@amorde amorde added the s2:confirmed Issues that have been confirmed by a CocoaPods contributor label Nov 16, 2023
@saldous
Copy link

saldous commented Nov 16, 2023

@amorde thank you, sorry for the rant, I appreciate all the Cocoapods team do. Note: you should also update this on your website: https://guides.cocoapods.org/using/getting-started.html#installation
image

@markhu
Copy link

markhu commented Nov 16, 2023

This combo seems to be a workaround for now. I'm running macOS Sonoma version 14.1 on my M1 Mac.

activesupport (6.1.7.6)
cocoapods (1.13.0)

@amorde
Copy link
Member

amorde commented Nov 16, 2023

Those docs should 100% be updated given where we are today. Especially since Apple plans to remove Ruby from macOS entirely at some point in the future

@amorde
Copy link
Member

amorde commented Nov 19, 2023

Fixed in 1.14.3. Let me know if there are still issues running on system Ruby.

@mrdc
Copy link

mrdc commented Jan 16, 2024

Fixed in 1.14.3. Let me know if there are still issues running on system Ruby.

Not fixed for me: macOS 14.2.1 on Apple Silicon via sudo gem install cocoapods. Via brew it works.
ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin23]

@elvsp1n
Copy link

elvsp1n commented Apr 13, 2024

Try upgrading ruby before installing cocoapods with:

brew install ruby
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc
echo 'export LDFLAGS="-L/usr/local/opt/ruby/lib"' >> ~/.zshrc 
echo 'export CPPFLAGS="-I/usr/local/opt/ruby/include"' >> ~/.zshrc
. ~/.zshrc
ruby -v
sudo gem install cocoapods
# Optional
# At the moment of writing, there seems to be an update for the gems, apply it with the following
sudo gem update --system 3.5.9

Cheers,
EE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s2:confirmed Issues that have been confirmed by a CocoaPods contributor
Projects
None yet
Development

No branches or pull requests