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

uninitialized constant AbstractController::Rendering in Rails 4.2 #32

Open
guigs opened this issue Dec 6, 2014 · 14 comments
Open

uninitialized constant AbstractController::Rendering in Rails 4.2 #32

guigs opened this issue Dec 6, 2014 · 14 comments

Comments

@guigs
Copy link

guigs commented Dec 6, 2014

I'm trying to migrate an app that still uses prototype from Rails 4.1 to 4.2.

I'm using Rails 4.2.rc2.

Steps to reproduce:

rails new testapp -j prototype
cd testapp
rails s

Throws this error:

ruby/gems/2.1.0/gems/actionpack-4.2.0.rc2/lib/action_controller/base.rb:204:in `<class:Base>': uninitialized constant AbstractController::Rendering (NameError)
@guigs
Copy link
Author

guigs commented Dec 8, 2014

Using branch 4.2 AND reverting bc80415 would fix the problem.

@grosser
Copy link
Contributor

grosser commented Dec 8, 2014

I think a better fix is requiring in in prototype-rails and not loading the test-case and relying on it's side-effects

@grosser
Copy link
Contributor

grosser commented Dec 11, 2014

... the revert bc80415 breaks it, with the if Rails.env.test? it works ... so fix is using a sha from before the revert ... or opening a rails issue to make TestCase load Rendering

@grosser
Copy link
Contributor

grosser commented Dec 11, 2014

if defined? ActionView::TestCase solution does not work.

@grosser
Copy link
Contributor

grosser commented Dec 11, 2014

if ActionView.const_defined?(:TestCase) also does not work ... nor does ActionView.constants.include?(:TestCase)

other options:

  • making requiring test-case not blow up (still ugly and unnecessary that it is loaded)
  • setting some config/initializer to get testing extensions (Rails.env.test? || config.load_prototype_test_extensions)

@guiman
Copy link
Contributor

guiman commented Jan 27, 2015

+1 I'm currently having the same problem. Any chances of rebasing branch 4.2 with current master? Looks like the fix was introduced into master and I'm trying to update from Rails 4.1 to 4.2 so having 4.2 up to day would save me (and everyone else doing it 😄) the fork

@rafaelfranca
Copy link
Member

Done

@guiman
Copy link
Contributor

guiman commented Jan 27, 2015

👍 thank you

@cpanderson
Copy link

Sorry, so what do we need to do to get rid of this issue with 4.2 and prototype-rails 4.0.0? Thanks.

@guigs
Copy link
Author

guigs commented Feb 4, 2015

In Gemfile:
gem 'prototype-rails', github: 'rails/prototype-rails', branch: '4.2'

@cpanderson
Copy link

Excellent. Thanks!

@shibabu
Copy link

shibabu commented Apr 27, 2015

WORKED FOR ME
gem 'prototype-rails', github: 'rails/prototype-rails', branch: '4.2'

@pschambacher
Copy link

There's some fixes in master that aren't in the 4.2 branch. Maybe it's time to get things merged back into master now? @rafaelfranca

@zedtux
Copy link

zedtux commented Dec 6, 2016

Any news on this boring bug please?

Luckily, in my case, my tests aren't testing anything which uses Javascript so I "fixed" my issue with the following in my Gemfile:

gem 'prototype-rails', '~> 4.0.0', group: [:development, :production]

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

8 participants