2

I upgraded to Rails 4 and now when some changes are made to the code, or when I do a reload! in rails console, I will get an ArgumentError: A copy of ApplicationHelper has been removed from the module tree but is still active! error.

I'm not the only one with this problem but still cant find existing solutions that work yet.

tommi
  • 6,883
  • 8
  • 37
  • 60
  • 1
    http://stackoverflow.com/questions/17561697/argumenterror-a-copy-of-applicationcontroller-has-been-removed-from-the-module – Muntasim Jan 17 '14 at 05:21
  • I am temporary avoiding this problem by doing the following - whenever this error occurs, I will browse away from that page (example, to the root url), then go back to the page where the error was occuring. This way, the error is gone and the code is also refreshed correctly. – tommi Jan 18 '14 at 05:33

1 Answers1

0

I've never encountered that problem before. I'm using Rails4 as well. I think you have to call your controller(which is shown in the ArgumentError) explicitly in your dependent controllers.

Can you try adding this line on top inside the class?

require "_controller"

Then try rails server -e production

See if this helps. Sorry I wish I could give you more detailed solution. If all else fails, rollback might be an option to consider.

  • Thanks for the suggestion! But that would mean I will not be able to make use of the code reload feature in development mode, am I right to say that? – tommi Jan 18 '14 at 05:35