0

到目前为止,我在部署我的应用程序时遇到的问题很少。但是,在今晚的部署之后,我收到了一个无法修复的应用程序错误。所以我从一周前从v7回滚到v4 。该应用程序再次运行,但我决定尝试“git push heroku master -f” v5,我认为不会在v7上发现应用程序错误。不幸的是,v5也给了我同样的错误。

之后,我尝试回滚到工作版本v4,但它仍然给了我一个错误。我尝试了另一个回滚,但它仍然给了我一个应用程序错误。然后我尝试从我的本地硬盘驱动器“git push heroku master -f” v4(我知道它有效),但它现在显示“一切都是最新的”。

我从这里做什么?我的应用程序无法在 heroku 上运行,我无法进行任何回滚,甚至无法推送现在可以使用的版本。我怎样才能让它工作?我想重新部署v4这是一个工作版本,并逐段重写代码以恢复到当前级别。

在开发环境中并在中查看时一切正常rails server 但是,这是我在运行时遇到的错误rails server -e production

Started GET "/" for 127.0.0.1 at 2013-04-09 02:09:49 -0700
Processing by StaticPagesController#home as HTML
Completed 500 Internal Server Error in 1ms

ActiveRecord::StatementInvalid (Could not find table 'users'):
  app/helpers/sessions_helper.rb:19:in `current_user'
  app/helpers/sessions_helper.rb:11:in `signed_in?'
  app/controllers/static_pages_controller.rb:3:in `home'




Started GET "/favicon.ico" for 127.0.0.1 at 2013-04-09 02:09:49 -0700

ActionController::RoutingError (No route matches [GET] "/favicon.ico"):
  actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `c
all'
  actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `ca
ll'
  railties (3.2.3) lib/rails/rack/logger.rb:26:in `call_app'
  railties (3.2.3) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.3) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.3) lib/active_support/cache/strategy/local_cache.rb:72:in `
call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
  rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
  rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
  rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
  rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
  railties (3.2.3) lib/rails/engine.rb:479:in `call'
  railties (3.2.3) lib/rails/application.rb:220:in `call'
  rack (1.4.5) lib/rack/content_length.rb:14:in `call'
  railties (3.2.3) lib/rails/rack/log_tailer.rb:14:in `call'
  rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
  C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `servi
ce'
  C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
  C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/server.rb:191:in `block in
start_thread'

但是,我在部署后使用的错误与控制器heroku logs的 Rails有关superclass mismatch error

4

2 回答 2

0

你这里有两个不相关的问题。 rails server -e production不起作用,因为您需要针对本地数据库的生产版本运行迁移,因此请执行以下操作:RAILS_ENV=production rake db:migrate

您的 Heroku 问题将与此无关。您将需要发布您的 Heroku 日志以heroku logs供任何人帮助您。

此外,强制 git push 到 Heroku 并不是回滚版本的方式。你这样做:heroku releases:rollback [RELEASE]

于 2013-04-10T22:35:12.763 回答
0

您的部分日志说您没有 table users

ActiveRecord::StatementInvalid(找不到表“用户”):
app/helpers/sessions_helper.rb:19:in signed_in? app/controllers/static_pages_controller.rb:3:in `home'current_user'
app/helpers/sessions_helper.rb:11:in

你申请迁移了吗?如果没有,请尝试:

rake db:migrate
于 2013-04-09T09:37:32.510 回答