bitrise-steplib / steps-cocoapods-install

MIT License
23 stars 18 forks source link

ActiveSupport #100

Closed harveyalex closed 10 months ago

harveyalex commented 11 months ago

Troubleshooting

Useful information

Issue description

While trying to build with cocoaPods 1.12.0, and Ruby 2.7.6, I was unable to, I get this issue:

/Users/vagrant/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/activesupport-7.1.0/lib/active_support/core_ext/array/conversions.rb:108:in <class:Array>': undefined methoddeprecator' for ActiveSupport:Module (NoMethodError) Did you mean?

Bitrise info

ConfigsModel:
- command: install
- source_root_path: /Users/vagrant/git
- podfile_path: 
- verbose: false
- is_cache_disabled: false
Searching for Podfile
Found Podfile: /Users/vagrant/git/ios/Podfile
Determining required cocoapods version
Searching for Podfile.lock
Found Podfile.lock: /Users/vagrant/git/ios/Podfile.lock
Required CocoaPods version (from Podfile.lock): 1.12.0
Searching for gem lockfile with cocoapods gem
No gem lockfile with cocoapods gem found at: 
Using system installed CocoaPods version
failed to check installed ruby version, ruby            2.7.6           Not installed. Run "asdf install ruby 2.7.6" error: exit status 1
Checking selected Ruby version
$ asdf "current" "ruby"
ruby            2.7.6           Not installed. Run "asdf install ruby 2.7.6"
Failed to print selected Ruby version: exit status 1
The selected Ruby version (2.7.6) is not installed.
Installing missing Ruby version
$ asdf "install" "ruby" "2.7.6"
To follow progress, use 'tail -f /var/folders/yy/6kcn9mkd5svdbqnznwf474f00000gn/T/ruby-build.20231006053250.16961.log' or pass --verbose
Downloading openssl-1.1.1v.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/d6697e2871e77238460402e9362d47d18382b15ef9f246aba6c7bd780d38a6b0
Installing openssl-1.1.1v...
Installed openssl-1.1.1v to /Users/vagrant/.asdf/installs/ruby/2.7.6
Downloading ruby-2.7.6.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.6.tar.bz2
Installing ruby-2.7.6...
WARNING: ruby-2.7.6 is nearing its end of life.
It only receives critical security updates, no bug fixes.
WARNING: ruby-2.7.6 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.
ruby-build: using readline from homebrew
ruby-build: using libyaml from homebrew
ruby-build: using gmp from homebrew
Installed ruby-2.7.6 to /Users/vagrant/.asdf/installs/ruby/2.7.6
Installing cocoapods
Checking cocoapods 1.12.0 gem
Installing
$ gem "install" "cocoapods" "--no-document" "-v" "1.12.0"
$ asdf "reshim" "ruby"
cocoapods version:
$ pod "_1.12.0_" "--version"
/Users/vagrant/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/activesupport-7.1.0/lib/active_support/core_ext/array/conversions.rb:108:in `': undefined method `deprecator' for ActiveSupport:Module (NoMethodError)
Did you mean?  deprecate_constant
    from /Users/vagrant/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/activesupport-7.1.0/lib/active_support/core_ext/array/conversions.rb:8:in `'
    from /Users/vagrant/.asdf/installs/ruby/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
    from /Users/vagrant/.asdf/installs/ruby/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
    from /Users/vagrant/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/lib/cocoapods.rb:9:in `'
    from /Users/vagrant/.asdf/installs/ruby/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
    from /Users/vagrant/.asdf/installs/ruby/2.7.6/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
    from /Users/vagrant/.asdf/installs/ruby/2.7.6/lib/ruby/gems/2.7.0/gems/cocoapods-1.12.0/bin/pod:36:in `'
    from /Users/vagrant/.asdf/installs/ruby/2.7.6/bin/pod:23:in `load'
    from /Users/vagrant/.asdf/installs/ruby/2.7.6/bin/pod:23:in `
' command failed, error: exit status 1 command failed, error: exit status 1

Steps to reproduce

The best way to reproduce I think is to create a react native project with the specified ruby version (2.7.6) and try to use 'activesupport' and see that it will fail, its a known issue that has occurred in the last 24 hours but I am unable to get the fix working detailed here https://github.com/CocoaPods/CocoaPods/issues/12080

Meegan commented 11 months ago

I'm also experiencing this, seems to have started for us yesterday, before then the builds were performing as expected.

benjaminkay93 commented 11 months ago

Getting the same problem, adding gem 'activesupport', '~> 7.0', '<= 7.0.8' to our Gemfile fixed it locally but i haven't yet found a work around for here

boo1ean commented 11 months ago

Here is a quick workaround:

  1. Insert Script step just before Run CocoaPods install
  2. Add to script content (adjust for your needs):
    asdf "install" "ruby" "2.7.5"
    gem uninstall activesupport
    gem install activesupport --version 7.0.8
benjaminkay93 commented 11 months ago

^ that worked, thank you very much @boo1ean 🙏

luisfsmn commented 11 months ago

Worked in here as well, thanks @boo1ean !

harveyalex commented 11 months ago

Here is a quick workaround:

  1. Insert Script step just before Run CocoaPods install
  2. Add to script content (adjust for your needs):
asdf "install" "ruby" "2.7.5"
gem uninstall activesupport
gem install activesupport --version 7.0.8

This worked for me but I used ruby "2.7.6" instead 🙏

NoAndThen commented 11 months ago

I'm seeing this issue on a react-native project. The issue with RN is that the Gemfile is not found in the same directory as the Podfile, it is one level up. So the solution shown above doesn't work in my case. What i would prefer is to be able to specify the directory in which the Gemfile is found.

edit: I should mention, one way to work around this at the moment is to add a script build step to copy Gemfile/Gemfile.lock from the ./ directory into the ./ios directory before running this build step.

mikpalm commented 10 months ago

I had to add the following to a Script block before Run CocoaPods install

asdf install ruby 2.7.6
asdf global ruby 2.7.6
gem uninstall activesupport
gem install activesupport --version 7.0.8

Then all worked in bitrise.

harveyalex commented 10 months ago

Installing the specific version of active support fixes the issue for me