rails: Rails console doesn't start - uninitialized constant Zeitwerk

Steps to reproduce

I’m following the master branch and experimenting with beta1. After the recent changes in branch, I can not start rails console and getting an error related with Zeitwerk.

Expected behavior

Rails console should start as usual.

Actual behavior

rails console, and rails console fails with an uninitialized constant Zeitwerk error.

Full error log: https://gist.github.com/msdundar/8a9f730e8603854748328abadb204370 Gemfile.lock: https://gist.github.com/msdundar/5c3d9bbb8a5fc2492a9f0cee9d056839

System configuration

Rails version:

  • 6.0.0.beta1

Ruby version:

  • ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-linux]

Bundler version:

  • 2.0.1

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

I can confirm that I can run rails console successfully when using https://github.com/rails/rails/commit/a20b00db3fd2e05a960c1d68cc7bce64733e49e7. I’ll let @msdundar also confirm this works for him.

I confirm the PR, now our app is working as expected. I tested it:

  • Without config.autoloader = :classic, so zeitwerk was active.
  • By adding config.autoloader = :classic after config.load_defaults 6.0

All are working now. Thanks @fxn and @danielcompton!

Since by now the main source of information for this feature is the PR description, I have added a remark about the position of the config override.

screenshot 2019-02-14 at 13 34 28

Thanks a lot @danielcompton. This is something definitely missing from CHANGELOG of railties. It’s also interesting that config.autoloader = :classic didn’t work for me when I add that to application.rb. However it’s working when I add it to development.rb, production.rb and test.rb.