我遇到了上述错误,但我相信我正在使用Rails 5:
turlingdrome$ rails -v
/Users/brianp/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/railties-5.2.3/lib/rails/app_loader.rb:53: warning: Insecure world writable dir /Users/brianp/work in PATH, mode 040777
Rails 5.2.0
turlingdrome$ rake db:migrate
rake aborted!
NameError: uninitialized constant ApplicationRecord
/Users/brianp/work/online-reporting/app/models/client.rb:1:in `<top (required)>'
/Users/brianp/work/online-reporting/config/routes.rb:7:in `block in <top (required)>'
/Users/brianp/work/online-reporting/config/routes.rb:1:in `<top (required)>'
/Users/brianp/work/online-reporting/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
我认为--trace不是很有用...但如果需要,可以将其附加上...