类User(TypeError)的超类不匹配?

我和Heroku有困难。 我做了heroku logs并收到错误消息:

 /app/app/models/user.rb:1:in `': superclass mismatch for class User (TypeError) /app/app/models/user.rb:1:in `': superclass mismatch for class User (TypeError) 2013-11-28T03:39:50.220378+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport- 3.2.11/lib/active_support/dependencies.rb:251:in `require' 2013-11-28T03:39:50.220378+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport- 3.2.11/lib/active_support/dependencies.rb:251:in `block in require' 2013-11-28T03:39:50.220378+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport- 3.2.11/lib/active_support/dependencies.rb:251:in `require' 2013-11-28T03:39:50.220378+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport- 3.2.11/lib/active_support/dependencies.rb:359:in `require_or_load' 2013-11-28T03:39:50.220378+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport- 3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency' 2013-11-28T03:39:50.220378+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport- 3.2.11/lib/active_support/dependencies.rb:313:in `depend_on' 2013-11-28T03:39:50.220378+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/activesupport- 3.2.11/lib/active_support/dependencies.rb:225:in `require_dependency' 2013-11-28T03:39:50.220378+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/engine.rb:438:in `each' 2013-11-28T03:39:50.220557+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/engine.rb:436:in `eager_load!' 2013-11-28T03:39:50.220557+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/engine.rb:438:in `block in eager_load!' 2013-11-28T03:39:50.220378+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!' 2013-11-28T03:39:50.220557+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/application/finisher.rb:53:in `block in ' 2013-11-28T03:39:50.220557+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec' 2013-11-28T03:39:50.220557+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run' 2013-11-28T03:39:50.220557+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/engine.rb:436:in `each' 2013-11-28T03:39:50.220557+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each' 2013-11-28T03:39:50.220557+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers' 2013-11-28T03:39:50.220696+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize' 2013-11-28T03:39:50.220557+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!' 2013-11-28T03:39:50.220696+00:00 app[web.1]: from /app/config/environment.rb:5:in `' 2013-11-28T03:39:50.220696+00:00 app[web.1]: from /app/config.ru:in `' 2013-11-28T03:39:50.220696+00:00 app[web.1]: from /app/config.ru:3:in `require' 2013-11-28T03:39:50.220557+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers' 2013-11-28T03:39:50.220696+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing' 2013-11-28T03:39:50.220696+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval' 2013-11-28T03:39:50.220696+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval' 2013-11-28T03:39:50.220696+00:00 app[web.1]: from /app/config.ru:in `new' 2013-11-28T03:39:50.221093+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/commands/server.rb:70:in `start' 2013-11-28T03:39:50.220696+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file' 2013-11-28T03:39:50.221093+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app' 2013-11-28T03:39:50.221093+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:200:in `app' 2013-11-28T03:39:50.220696+00:00 app[web.1]: from /app/config.ru:3:in `block in ' 2013-11-28T03:39:50.221093+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/commands/server.rb:46:in `app' 2013-11-28T03:39:50.221093+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap' 2013-11-28T03:39:50.221093+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:254:in `start' 2013-11-28T03:39:50.221093+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/commands.rb:55:in `block in ' 2013-11-28T03:39:50.221093+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.11/lib/rails/commands.rb:50:in `' 2013-11-28T03:39:50.221093+00:00 app[web.1]: from script/rails:6:in `require' 2013-11-28T03:39:50.221093+00:00 app[web.1]: from script/rails:6:in `' 2013-11-28T03:39:51.352167+00:00 heroku[web.1]: Process exited with status 1 2013-11-28T03:39:51.375056+00:00 heroku[web.1]: State changed from starting to crashed 

我无法理解为什么我收到此错误,因为我没有/models/user.rb/。 是。 我实际上做了一次并已经删除了它。

你能给我一些建议吗?

看着

 /app/app/models/user.rb 

应用程序/应用程序? 这是关闭。 调查你的项目源,你确实有一个user.rb文件

我确信这个问题不适合你。 但对于那些会在这里寻找解决方案的人,我只想提一个可能的原因。 我在跟随Michael Hartl的“Rails Tutorial”时遇到了这样的错误。 在我的情况下,这是我的疏忽 – 我放置文件example_user.rb (来自章节4.4.5用户类 )不在应用程序的根目录中,而是在controllers文件夹中。 在我修复之后 – Heroku的麻烦消失了。