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

undefined method `deprecator' for ActiveSupport:Module (NoMethodError) #21585

Open
AndrewLiu2021 opened this issue Oct 19, 2023 · 11 comments
Open

Comments

@AndrewLiu2021
Copy link

/usr/local/Cellar/fastlane/2.216.0/libexec/gems/activesupport-7.1.1/lib/active_support/core_ext/array/conversions.rb:108:in <class:Array>': undefined method deprecator' for ActiveSupport:Module (NoMethodError)

deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator
^^^^^^^^^^^

@zhekix
Copy link

zhekix commented Oct 19, 2023

gem 'activesupport', '~> 7.0.8'

Add this line in Gemfile and call bundle install

@joomsch
Copy link

joomsch commented Oct 21, 2023

gem 'activesupport', '~> 7.0.8'

Add this line in Gemfile and call bundle install

I've added gem 'activesupport', '~> 7.0.8' to my gemfile and run bundle install, but I still get the above error. The output of bundle install shows the correct version (7.0.8) but when running fastlane it still tries to use activesupport-7.1.1. Any other ideas?

/opt/homebrew/Cellar/fastlane/2.216.0/libexec/gems/activesupport-7.1.1/lib/active_support/core_ext/array/conversions.rb:108:in `<class:Array>': undefined method `deprecator' for ActiveSupport:Module (NoMethodError)

  deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator
                                                          ^^^^^^^^^^^
Did you mean?  deprecate_constant
	from /opt/homebrew/Cellar/fastlane/2.216.0/libexec/gems/activesupport-7.1.1/lib/active_support/core_ext/array/conversions.rb:8:in `<top (required)>'
	from <internal:/opt/homebrew/Cellar/ruby@3.1/3.1.4/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/opt/homebrew/Cellar/ruby@3.1/3.1.4/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /opt/homebrew/Cellar/fastlane/2.216.0/libexec/gems/cocoapods-1.13.0/lib/cocoapods.rb:9:in `<top (required)>'
	from <internal:/opt/homebrew/Cellar/ruby@3.1/3.1.4/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/opt/homebrew/Cellar/ruby@3.1/3.1.4/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /opt/homebrew/Cellar/fastlane/2.216.0/libexec/gems/cocoapods-1.13.0/bin/pod:36:in `<top (required)>'
	from /opt/homebrew/Cellar/fastlane/2.216.0/libexec/bin/pod:25:in `load'
	from /opt/homebrew/Cellar/fastlane/2.216.0/libexec/bin/pod:25:in `<main>'
error Command failed with exit code 1.

@mokagio
Copy link
Contributor

mokagio commented Oct 22, 2023

Hey @joomsch, in the logs you shared, the Fastlane binary comes from the Homebrew installation (/opt/homebrew/Cellar/fastlane). I assume you have been invoking Fastlane with fastlane?

To use the one installed with Bundler, that is the one that should use the gem set defined in your Gemfile, you'll need to run it via bundle exec fastlane.

Hope this helps.

@broomfn
Copy link

broomfn commented Oct 25, 2023

Hi,

I'm getting the same issue when doing a "pod install"

$ pod install
Traceback (most recent call last):
	9: from /Users/developer/.rbenv/versions/2.7.3/bin/pod:23:in `<main>'
	8: from /Users/developer/.rbenv/versions/2.7.3/bin/pod:23:in `load'
	7: from /Users/developer/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/cocoapods-1.13.0/bin/pod:36:in `<top (required)>'
	6: from /Users/developer/.rbenv/versions/2.7.3/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
	5: from /Users/developer/.rbenv/versions/2.7.3/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
	4: from /Users/developer/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/cocoapods-1.13.0/lib/cocoapods.rb:9:in `<top (required)>'
	3: from /Users/developer/.rbenv/versions/2.7.3/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
	2: from /Users/developer/.rbenv/versions/2.7.3/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
	1: from /Users/developer/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-7.1.1/lib/active_support/core_ext/array/conversions.rb:8:in `<top (required)>'
/Users/developer/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/activesupport-7.1.1/lib/active_support/core_ext/array/conversions.rb:108:in `<class:Array>': undefined method `deprecator' for ActiveSupport:Module (NoMethodError)
Did you mean?  deprecate_constant

Not using fastlane, any ideas how to fix it? I've tried the suggested Gemfile fix but still get the same issue 🤷‍♂️

Thanks

@mokagio
Copy link
Contributor

mokagio commented Oct 25, 2023

@broomfn are you running pod install or bundle exec pod install?

The gems defined in Gemfile are used only when running through Bundler, that is, through bundle exec <command>.

@Jcarloluna
Copy link

@broomfn are you running pod install or bundle exec pod install?

The gems defined in Gemfile are used only when running through Bundler, that is, through bundle exec <command>.

thanks, worked for me

@joomsch
Copy link

joomsch commented Oct 26, 2023

Hey @joomsch, in the logs you shared, the Fastlane binary comes from the Homebrew installation (/opt/homebrew/Cellar/fastlane). I assume you have been invoking Fastlane with fastlane?

To use the one installed with Bundler, that is the one that should use the gem set defined in your Gemfile, you'll need to run it via bundle exec fastlane.

Hope this helps.

It did. Thank you so much!

@broomfn
Copy link

broomfn commented Oct 26, 2023

Thanks @mokagio ,

This link might also be useful for some people...rails/rails#49495 (comment)

@ingemar
Copy link

ingemar commented Nov 26, 2023

If you came here via a web search, you're probably looking for Stand-Alone Active Support.

@rubywarlock
Copy link

rubywarlock commented Dec 27, 2023

I came across this error, but I don't understand what clock.rb has to do with it? the error occurs on the line require 'active_support/time in the file 'spec_helper.rb`

@faizy-ahmed
Copy link

Delete Gemfile.lock and run bundler exec pod install
It resolves my issue on cocoapods 1.13.0.

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

9 participants