Skip to content

Fix autoload error #1571

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

Merged
merged 1 commit into from
Mar 13, 2016
Merged

Fix autoload error #1571

merged 1 commit into from
Mar 13, 2016

Conversation

bquorning
Copy link
Contributor

The specs are currently failing for using Rails 5.0.0.beta2. It looks like the changes from #1388 has something to do with it. I won’t claim to understand all (or anything) of that pull request, but by changing a few pieces, I got the spec suite running and not have only 1 failing spec locally. Let’s see what Travis says.

cc/ @cupakromer

@bquorning
Copy link
Contributor Author

Note that I included the 1 commit from #1570 which will (hopefully) eventually be merged on its own.

@bquorning
Copy link
Contributor Author

There you go: a green build. I don’t really understand why my changes make it work.

I noticed that the build error started in the example app’s config/initializers/action_mailer.rb when it references ActionMailer::Base:

NameError: uninitialized constant AbstractController::Rendering
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta2/lib/action_controller/base.rb:204:in `<class:Base>'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta2/lib/action_controller/base.rb:164:in `<module:ActionController>'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta2/lib/action_controller/base.rb:5:in `<top (required)>'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/actionview-5.0.0.beta2/lib/action_view/test_case.rb:11:in `<class:TestCase>'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/actionview-5.0.0.beta2/lib/action_view/test_case.rb:10:in `<module:ActionView>'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/actionview-5.0.0.beta2/lib/action_view/test_case.rb:8:in `<top (required)>'
/home/travis/build/rspec/bundle/ruby/2.2.0/bundler/gems/rails-controller-testing-ce370fe84883/lib/rails-controller-testing.rb:16:in `block in <top (required)>'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta2/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta2/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta2/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta2/lib/active_support/lazy_load_hooks.rb:44:in `each'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/activesupport-5.0.0.beta2/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/actionview-5.0.0.beta2/lib/action_view/base.rb:215:in `<class:Base>'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/actionview-5.0.0.beta2/lib/action_view/base.rb:139:in `<module:ActionView>'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/actionview-5.0.0.beta2/lib/action_view/base.rb:10:in `<top (required)>'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/actionview-5.0.0.beta2/lib/action_view/view_paths.rb:1:in `<top (required)>'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/actionpack-5.0.0.beta2/lib/abstract_controller/rendering.rb:4:in `<top (required)>'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/actionmailer-5.0.0.beta2/lib/action_mailer/base.rb:426:in `<class:Base>'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/actionmailer-5.0.0.beta2/lib/action_mailer/base.rb:420:in `<module:ActionMailer>'
/home/travis/build/rspec/bundle/ruby/2.2.0/gems/actionmailer-5.0.0.beta2/lib/action_mailer/base.rb:9:in `<top (required)>'
/home/travis/build/rspec/rspec-rails/tmp/example_app/config/initializers/action_mailer.rb:15:in `<top (required)>'

For some reason, there’s a circular dependency! Notice how abstract_controller/rendering.rb:4 is in the trace, and module Rendering isn’t defined until line 16.

@bquorning
Copy link
Contributor Author

Sigh … specs are failing for Rails master.

@JonRowe
Copy link
Member

JonRowe commented Mar 10, 2016

Kinda expected, to merge this it needs squashing, also shouldn't it be < 5 not 4? 4 builds fine.

@bquorning
Copy link
Contributor Author

4 builds fine without the hack, so I see no need to include it.

It seems that only Rails 3.x needs these lines for the specs to run.
@bquorning bquorning force-pushed the fix-autoload-error branch from 3a91e72 to 3aed657 Compare March 11, 2016 07:08
@bquorning
Copy link
Contributor Author

Squashed.

JonRowe added a commit that referenced this pull request Mar 13, 2016
@JonRowe JonRowe merged commit c1b1979 into rspec:master Mar 13, 2016
@bquorning bquorning deleted the fix-autoload-error branch March 20, 2016 09:40
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

Successfully merging this pull request may close these issues.

2 participants