heroku运行分离的rake db setup错误

时间:2014-01-19 11:40:55

标签: ruby-on-rails ruby heroku ruby-on-rails-4

我正在关注[Ruby on Rails教程,http://railsinstallfest.org/guides/installfest/getting_started/, 我在Heroku上运行我的应用程序时遇到了麻烦。我希望找人帮助我。

这是我的问题的日志,它是在我运行命令

时生成的

heroku run:detached rake db:setup

2014-01-19T07:49:39.839922+00:00 app[run.4729]:    -> 0.1320s
2014-01-19T07:49:39.839922+00:00 app[run.4729]: -- create_table("comments", {:force=>true})
2014-01-19T07:49:39.839922+00:00 app[run.4729]: -- add_index("comments", ["post_id"], {:name=>"index_comments_on_post_id", :using=>:btree})
2014-01-19T07:49:39.839922+00:00 app[run.4729]:    -> 0.0365s
2014-01-19T07:49:39.839922+00:00 app[run.4729]: -- create_table("posts", {:force=>true})
2014-01-19T07:49:39.839922+00:00 app[run.4729]: -- initialize_schema_migrations_table()
2014-01-19T07:49:39.839922+00:00 app[run.4729]:    -> 1.0849s
2014-01-19T07:49:39.839922+00:00 app[run.4729]:    -> 0.0030s
2014-01-19T07:49:39.839922+00:00 app[run.4729]:    -> 0.0897s
2014-01-19T07:49:41.011590+00:00 heroku[run.4729]: Process exited with status 0
2014-01-19T07:49:41.028919+00:00 heroku[run.4729]: State changed from up to complete
2014-01-19T08:19:28.504357+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by fcamatti@gmail.com
2014-01-19T08:19:32.472345+00:00 heroku[run.8654]: Starting process with command `bundle exec rake db:migrate`
2014-01-19T08:19:33.081263+00:00 heroku[run.8654]: State changed from starting to up
2014-01-19T08:19:36.539370+00:00 heroku[run.8654]: Process exited with status 0
2014-01-19T08:19:36.559509+00:00 heroku[run.8654]: State changed from up to complete
2014-01-19T08:20:14.858681+00:00 heroku[web.1]: Unidling
2014-01-19T08:20:14.858681+00:00 heroku[web.1]: State changed from down to starting
2014-01-19T08:20:17.912642+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 3628 -e $RAILS_ENV`
2014-01-19T08:20:20.280071+00:00 app[web.1]: [2014-01-19 08:20:20] INFO  WEBrick 1.3.1
2014-01-19T08:20:20.280071+00:00 app[web.1]: [2014-01-19 08:20:20] INFO  ruby 2.0.0 (2013-11-22) [x86_64-linux]
2014-01-19T08:20:20.280071+00:00 app[web.1]: [2014-01-19 08:20:20] INFO  WEBrick::HTTPServer#start: pid=2 port=3628
2014-01-19T08:20:20.797806+00:00 heroku[web.1]: State changed from starting to up
2014-01-19T08:20:22.002181+00:00 heroku[router]: at=info method=GET path=/ host=shrouded-hamlet-9456.herokuapp.com request_id=9b341ac3-c58c-489b-ad47-91076a5f762d fwd="124.149.104.105" dyno=web.1 connect=1ms service=88ms status=404 bytes=1351
2014-01-19T08:20:25.860279+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=shrouded-hamlet-9456.herokuapp.com request_id=76b6c4db-a957-4831-b86d-eeae8a5f25bb fwd="124.149.104.105" dyno=web.1 connect=1ms service=8ms status=404 bytes=1351
2014-01-19T09:25:18.132575+00:00 heroku[web.1]: Idling
2014-01-19T09:25:18.133586+00:00 heroku[web.1]: State changed from up to down
2014-01-19T09:25:20.870101+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2014-01-19T09:25:21.483722+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in `start'
2014-01-19T09:25:21.483722+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
2014-01-19T09:25:21.483924+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
2014-01-19T09:25:21.483722+00:00 app[web.1]: [2014-01-19 09:25:21] FATAL SignalException: SIGTERM
2014-01-19T09:25:21.483722+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
2014-01-19T09:25:21.483722+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `block in start'
2014-01-19T09:25:21.483722+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands/server.rb:84:in `start'
2014-01-19T09:25:21.483722+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `select'
2014-01-19T09:25:21.483722+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:in `start'
2014-01-19T09:25:21.483722+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:14:in `run'
2014-01-19T09:25:21.483924+00:00 app[web.1]:    bin/rails:4:in `require'
2014-01-19T09:25:21.483924+00:00 app[web.1]:    bin/rails:4:in `<main>'
2014-01-19T09:25:21.484393+00:00 app[web.1]: [2014-01-19 09:25:21] INFO  WEBrick::HTTPServer#start done.
2014-01-19T09:25:21.483722+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (required)>'
2014-01-19T09:25:21.483924+00:00 app[web.1]: [2014-01-19 09:25:21] INFO  going to shutdown ...
2014-01-19T09:25:21.510762+00:00 app[web.1]: => Booting WEBrick
2014-01-19T09:25:21.510762+00:00 app[web.1]: => Rails 4.0.2 application starting in production on http://0.0.0.0:3628
2014-01-19T09:25:21.510762+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-01-19T09:25:21.510762+00:00 app[web.1]: => Run `rails server -h` for more startup options
2014-01-19T09:25:21.510762+00:00 app[web.1]: F, [2014-01-19T08:20:22.006714 #2] FATAL -- : 
2014-01-19T09:25:21.510762+00:00 app[web.1]: I, [2014-01-19T08:20:21.933721 #2]  INFO -- : Started GET "/" for 124.149.104.105 at 2014-01-19 08:20:21 +0000
2014-01-19T09:25:21.510762+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2014-01-19T09:25:21.510762+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2014-01-19T09:25:21.510762+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/"):
2014-01-19T09:25:21.510762+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/rack/logger.rb:38:in `call_app'
2014-01-19T09:25:21.510982+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/rack/logger.rb:20:in `block in call'
2014-01-19T09:25:21.510982+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2014-01-19T09:25:21.510982+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-01-19T09:25:21.510982+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in `tagged'
2014-01-19T09:25:21.510982+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:25:in `tagged'
2014-01-19T09:25:21.510982+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-01-19T09:25:21.510982+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/rack/logger.rb:20:in `call'
2014-01-19T09:25:21.511133+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:97:in `call'
2014-01-19T09:25:21.510982+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-01-19T09:25:21.510982+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-01-19T09:25:21.510982+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
2014-01-19T09:25:21.511133+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:511:in `call'
2014-01-19T09:25:21.511133+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-01-19T09:25:21.511133+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2014-01-19T09:25:21.511133+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-01-19T09:25:21.511133+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-01-19T09:25:21.511133+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-01-19T09:25:21.511133+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-01-19T09:25:21.511133+00:00 app[web.1]: 
2014-01-19T09:25:21.511566+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
2014-01-19T09:25:21.511566+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/rack/logger.rb:20:in `block in call'
2014-01-19T09:25:21.511566+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/rack/logger.rb:38:in `call_app'
2014-01-19T09:25:21.511566+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:25:in `tagged'
2014-01-19T09:25:21.511566+00:00 app[web.1]: I, [2014-01-19T08:20:25.859873 #2]  INFO -- : Started GET "/favicon.ico" for 124.149.104.105 at 2014-01-19 08:20:25 +0000
2014-01-19T09:25:21.511566+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in `tagged'
2014-01-19T09:25:21.511566+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in `block in tagged'
2014-01-19T09:25:21.511133+00:00 app[web.1]: 
2014-01-19T09:25:21.511566+00:00 app[web.1]: ActionController::RoutingError (No route matches [GET] "/favicon.ico"):
2014-01-19T09:25:21.511713+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:97:in `call'
2014-01-19T09:25:21.511713+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2014-01-19T09:25:21.511566+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2014-01-19T09:25:21.511713+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/rack/logger.rb:20:in `call'
2014-01-19T09:25:21.512033+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2014-01-19T09:25:21.511566+00:00 app[web.1]: F, [2014-01-19T08:20:25.861261 #2] FATAL -- : 
2014-01-19T09:25:21.511713+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
2014-01-19T09:25:21.511713+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
2014-01-19T09:25:21.511713+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
2014-01-19T09:25:21.511713+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:511:in `call'
2014-01-19T09:25:21.511713+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2014-01-19T09:25:21.512033+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2014-01-19T09:25:21.512033+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2014-01-19T09:25:21.511713+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
2014-01-19T09:25:21.511713+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2014-01-19T09:25:21.512033+00:00 app[web.1]:   vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2014-01-19T09:25:21.512033+00:00 app[web.1]: 
2014-01-19T09:25:21.512033+00:00 app[web.1]: 
2014-01-19T09:25:21.512033+00:00 app[web.1]: Exiting
2014-01-19T09:25:22.825919+00:00 heroku[web.1]: Process exited with status 143

1 个答案:

答案 0 :(得分:0)

您的教程中的config / routes.rb文件似乎错过了根路径。该行被评论:

QuickBlog::Application.routes.draw do
  resources :posts do
    resources :comments, :only => [:create]
  end

  # root :to => 'welcome#index'
end


在您的日志中,您可以看到这被视为致命错误:

  

ActionController :: RoutingError(没有路由匹配[GET]“/”):

我不完全确定,但Heroku不会抱怨你的应用程序没有“入口”点吗?您的教程以Rails 3.2为先决条件,您的日志告诉您使用Rails 4.0.2。

这是Heroku文档中关于此版本的内容:

  

Rails 4在生产中不再具有静态索引页面。当您使用新应用时,生产中将没有根页面,因此我们需要创建一个


我希望这会有所帮助。