2012-11-19 54 views
1

我認爲問題在於我在使用SQLite3,所以我遷移到了PostgreSQL,但問題仍然存在。該應用在當地正常工作。我打開我的應用程序的Heroku與打開,它給了我下面的錯誤:Rails:Heroku第一次部署失敗

Application Error. An error occurred in the application and your page could not be served. Please try again in a few moments. If you are the application owner, check your logs for details.. 

我試圖通過查看日誌來尋找解決方案,但是失敗了,所以我需要別人的幫助。 這裏是我的日誌,我感謝任何幫助!

2012-11-19T00:55:37+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e production -p 3545` 
2012-11-19T00:55:39+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your 
the release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2012-11-19T00:55:39+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your 
the release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/application.rb:136:in `initialize!' 
2012-11-19T00:55:41+00:00 app[web.1]: /app/config/initializers/formtastic.rb:2:in `<top (required)>': uninitialized constant Formtastic (NameError) 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `run' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/engine.rb:587:in `each' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/initializable.rb:55:in `block in run_initializers' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `instance_exec' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/engine.rb:587:in `block in <class:Engine>' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `each' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `run_initializers' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/railtie/configurable.rb:30:in `method_missing' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>' 

2012-11-19T00:55:41+00:00 app[web.1]: from config.ru:3:in `require' 
2012-11-19T00:55:41+00:00 app[web.1]: from config.ru:3:in `block in <main>' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize' 
2012-11-19T00:55:41+00:00 app[web.1]: from config.ru:1:in `new' 
2012-11-19T00:55:41+00:00 app[web.1]: from config.ru:1:in `<main>' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/rack/adapter/loader.rb:33:in `eval' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/rack/adapter/loader.rb:33:in `load' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/controllers/controller.rb:181:in `load_rackup_config' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/runner.rb:187:in `run_command' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/runner.rb:152:in `run!' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/bin/thin:6:in `<top (required)>' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bin/thin:19:in `load' 

2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/bin/thin:19:in `<main>' 
2012-11-19T00:55:41+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/controllers/controller.rb:71:in `start' 
2012-11-19T00:55:42+00:00 heroku[web.1]: Process exited with status 1 
2012-11-19T00:56:34+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=fast-savannah-6843.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes= 
2012-11-19T00:56:34+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=fast-savannah-6843.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes= 
2012-11-19T00:57:44+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=fast-savannah-6843.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes= 
2012-11-19T00:57:44+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=fast-savannah-6843.herokuapp.com fwd= dyno= queue= wait= connect= service= status=503 bytes= 
+0

你已經包含在你的gemfile中的Formtastic,對吧? – rjz

+0

是的! gem'sass-rails','〜> 3.2.3' gem'coffee-rails','〜> 3.2.1' gem'bootstrap-sass' gem'formtastic-bootstrap' –

+0

你在運行rails server之前試過做bundle安裝? –

回答

5

對於首次部署者,這裏是我的問題,我是如何解決他們:

1 RailsInstaller和Heroku的列工具不能完美兼容:如果遇到問題在安裝Heroku工具欄後,我建議您一併刪除railsinstaller和heroku工具欄,然後重新安裝railsinstaller。然後,在您的gem文件中,只需添加gem 'heroku'並運行軟件包安裝。我不需要任何額外的東西來成功部署我的應用程序。 Heroku Toolbelt安裝紅寶石1.9.2 v,併爲您的偏好添加錯誤路徑。你可以選擇手動修復這個PATH到正確的位置,例如)C:RailsInstaller:Ruby1.9.3,但我發現重新安裝所有東西更容易。

2.您必須遷移從sqlite3的到PostgreSQL:遵循this,如果你不知道如何做到這一點。

3.按照Heroku教程最終部署您的應用程序:follow this。如果您收到錯誤消息,提示「對象不存在」,請嘗試運行heroku run rake db:migrate

祝你好運部署!