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 `alias_method_chain' for ActionController::Base:Class #46705

Closed
arshekas opened this issue Dec 12, 2022 · 2 comments
Closed

Comments

@arshekas
Copy link

Hi,

We have updated our rails app from rails 4.2.6 to rails 5.2.5 and ruby version from 2.3.0 to 2.6.6, we have changed the code according to here https://gist.github.com/anklos/eb0088e26223c92a034cd1ea36fcee2c. However, when we run the application we are getting this error somewhere from application.rb

code from application.rb where erroring out

require File.expand_path('../boot', __FILE__)

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups). **THIS LINE GIVING ERROR**

Error

`block in <module:ControllerHelper>': undefined method `alias_method_chain' for ActionController::Base:Class (NoMethodError)
Did you mean?  alias_method

Any help would be appreciated!

Thanks

@nvasilevski
Copy link
Contributor

nvasilevski commented Dec 12, 2022

Is there a stacktrace available for the exception? As Eileen pointed out in a different issue, it is unlikely caused by Rails and most likely called from one of the gems. Similar to #46660 (comment)

You can look through the source for Rails 5.2.5 https://github.dev/rails/rails/tree/cb0a558f42fc6957fac4d2daa16771b72ff7da6e and see that nothing in Rails 5.2.5 is calling alias_method_chain
image

Based on a very similar issue, usually stacktrace should point to the code that is still using removed alias_method_chain method

@eileencodes
Copy link
Member

Closing because this isn't a bug in Rails, 5.2 removed all calls to alias_method_chain so it's the app or another gem.

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

3 participants