2013-08-21 127 views
0

讓我首先說我對heroku/ruby​​/rails很新。我正在通過Michael Hartl的Ruby on Rails教程,當我使用'rails s'在本地服務器上部署應用程序時,一切都顯示正常。但是,當我將我的應用程序推送到heroku並使用'heroku open'進行部署時,該應用似乎跳過了所有資產。我確認了資產管道已啓用,但仍然無法讓我的應用程序以任何格式部署到heroku上。Heroku部署沒有格式?

我一直在看heroku日誌,但似乎唯一的錯誤是一個致命的SignalException,但我不知道這是指什麼。此外,如果有人能夠解釋棄用警告是否嚴重,我會非常感激。

Heroku的日誌:

2013-08-20T23:23:14.690294+00:00 app[web.1]: [2013-08-20 23:23:14] FATAL SignalException: SIGTERM 
2013-08-20T23:23:14.690294+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `select' 
2013-08-20T23:23:14.690294+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `block in start' 
2013-08-20T23:23:14.690294+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:in `start' 
2013-08-20T23:23:14.690294+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in `start' 
2013-08-20T23:23:14.690294+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler/webrick.rb:13:in `run' 
2013-08-20T23:23:14.690294+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.3/lib/rails/commands/server.rb:70:in `start' 
2013-08-20T23:23:14.690294+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:268:in `start' 
2013-08-20T23:23:14.690294+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.3/lib/rails/commands.rb:55:in `block in <top (required)>' 
2013-08-20T23:23:14.690514+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.3/lib/rails/commands.rb:50:in `<top (required)>' 
2013-08-20T23:23:14.690514+00:00 app[web.1]: script/rails:6:in `require' 
2013-08-20T23:23:14.690294+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap' 
2013-08-20T23:23:14.690514+00:00 app[web.1]: script/rails:6:in `<main>' 
2013-08-20T23:23:14.690825+00:00 app[web.1]: [2013-08-20 23:23:14] INFO going to shutdown ... 
2013-08-20T23:23:14.691003+00:00 app[web.1]: [2013-08-20 23:23:14] INFO WEBrick::HTTPServer#start done. 
2013-08-20T23:23:14.691149+00:00 app[web.1]: Exiting 
2013-08-20T23:23:16.134514+00:00 heroku[web.1]: Process exited with status 143 
2013-08-20T23:23:17.437119+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 45415` 
2013-08-20T23:23:20.063810+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 Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2013-08-20T23:23:20.063810+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 Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2013-08-20T23:23:20.892393+00:00 app[web.1]:   SECURITY WARNING: No secret option provided to Rack::Session::Cookie. 
2013-08-20T23:23:20.892393+00:00 app[web.1]:   This poses a security threat. It is strongly recommended that you 
2013-08-20T23:23:20.892393+00:00 app[web.1]:   future versions will even invalidate your existing user cookies. 
2013-08-20T23:23:20.892393+00:00 app[web.1]:   Called from: /app/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.3/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'. 
2013-08-20T23:23:20.892393+00:00 app[web.1]:   provide a secret to prevent exploits that may be possible from crafted 
2013-08-20T23:23:20.892393+00:00 app[web.1]:   cookies. This will not be supported in future versions of Rack, and 
2013-08-20T23:23:20.892393+00:00 app[web.1]: 
2013-08-20T23:23:21.462460+00:00 heroku[web.1]: State changed from starting to up 
2013-08-20T23:23:21.255176+00:00 app[web.1]: [2013-08-20 23:23:21] INFO WEBrick 1.3.1 
2013-08-20T23:23:21.255176+00:00 app[web.1]: [2013-08-20 23:23:21] INFO ruby 2.0.0 (2013-06-27) [x86_64-linux] 
2013-08-20T23:23:21.255549+00:00 app[web.1]: [2013-08-20 23:23:21] INFO WEBrick::HTTPServer#start: pid=2 port=45415 
2013-08-20T23:23:26.146248+00:00 app[web.1]: => Ctrl-C to shutdown server 
2013-08-20T23:23:26.146248+00:00 app[web.1]: 
2013-08-20T23:23:26.146248+00:00 app[web.1]: 
2013-08-20T23:23:26.146248+00:00 app[web.1]: Started GET "/" for 69.254.153.186 at 2013-08-20 23:23:26 +0000 
2013-08-20T23:23:26.146248+00:00 app[web.1]: => Booting WEBrick 
2013-08-20T23:23:26.146248+00:00 app[web.1]: => Rails 3.2.3 application starting in production on http://0.0.0.0:45415 
2013-08-20T23:23:26.146248+00:00 app[web.1]: => Call with -d to detach 
2013-08-20T23:23:26.489483+00:00 app[web.1]: Rendered static_pages/home.html.erb within layouts/application (2.2ms) 
2013-08-20T23:23:26.481456+00:00 app[web.1]: Processing by StaticPagesController#home as HTML 
2013-08-20T23:23:26.496375+00:00 app[web.1]: Rendered layouts/_header.html.erb (1.3ms) 
2013-08-20T23:23:26.494575+00:00 app[web.1]: Rendered layouts/_shim.html.erb (0.3ms) 
2013-08-20T23:23:26.497960+00:00 app[web.1]: Completed 200 OK in 16ms (Views: 15.8ms | ActiveRecord: 0.0ms) 
2013-08-20T23:23:26.497774+00:00 app[web.1]: Rendered layouts/_footer.html.erb (0.9ms) 
2013-08-20T23:23:26.670396+00:00 heroku[router]: at=info method=GET path=/assets/application-3428e82709d7645135002c8fadfafdc6.js host=peaceful-sierra-3634.herokuapp.com fwd="69.254.153.186" dyno=web.1 connect=4ms service=20ms status=200 bytes=642 
2013-08-20T23:23:26.693364+00:00 heroku[router]: at=info method=GET path=/assets/application-7270767b2a9e9fff880aa5de378ca791.css host=peaceful-sierra-3634.herokuapp.com fwd="69.254.153.186" dyno=web.1 connect=2ms service=26ms status=200 bytes=0 
2013-08-20T23:23:26.795663+00:00 heroku[router]: at=info method=GET path=/assets/rails-be8732dac73d845ac5b142c8fb5f9fb0.png host=peaceful-sierra-3634.herokuapp.com fwd="69.254.153.186" dyno=web.1 connect=1ms service=9ms status=200 bytes=6646 
2013-08-20T23:23:26.506094+00:00 heroku[router]: at=info method=GET path=/ host=peaceful-sierra-3634.herokuapp.com fwd="69.254.153.186" dyno=web.1 connect=2ms service=380ms status=304 bytes=0 
2013-08-21T00:29:30.830550+00:00 heroku[web.1]: Idling 
2013-08-21T00:29:35.491771+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2013-08-21T00:29:36.117015+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `select' 
2013-08-21T00:29:36.117015+00:00 app[web.1]: [2013-08-21 00:29:36] FATAL SignalException: SIGTERM 
2013-08-21T00:29:36.117015+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in `start' 
2013-08-21T00:29:36.117015+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.3/lib/rails/commands/server.rb:70:in `start' 
2013-08-21T00:29:36.117015+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:in `start' 
2013-08-21T00:29:36.117015+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.3/lib/rails/commands.rb:55:in `block in <top (required)>' 
2013-08-21T00:29:36.117176+00:00 app[web.1]: script/rails:6:in `<main>' 
2013-08-21T00:29:36.117176+00:00 app[web.1]: [2013-08-21 00:29:36] INFO going to shutdown ... 
2013-08-21T00:29:36.117176+00:00 app[web.1]: [2013-08-21 00:29:36] INFO WEBrick::HTTPServer#start done. 
2013-08-21T00:29:36.117176+00:00 app[web.1]: Exiting 
2013-08-21T00:29:36.117015+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:268:in `start' 
2013-08-21T00:29:36.117015+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `block in start' 
2013-08-21T00:29:36.117015+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler/webrick.rb:13:in `run' 
2013-08-21T00:29:36.117176+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.3/lib/rails/commands.rb:50:in `<top (required)>' 
2013-08-21T00:29:36.117176+00:00 app[web.1]: script/rails:6:in `require' 
2013-08-21T00:29:36.117015+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap' 
2013-08-21T00:29:37.526666+00:00 heroku[web.1]: State changed from up to down 
2013-08-21T00:29:37.523783+00:00 heroku[web.1]: Process exited with status 143 
2013-08-21T22:25:21.381126+00:00 heroku[web.1]: Unidling 
2013-08-21T22:25:21.381126+00:00 heroku[web.1]: State changed from down to starting 
2013-08-21T22:25:27.384489+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 5284` 
2013-08-21T22:25:33.072380+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 Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2013-08-21T22:25:33.072739+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 Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2013-08-21T22:25:33.666165+00:00 app[web.1]:   SECURITY WARNING: No secret option provided to Rack::Session::Cookie. 
2013-08-21T22:25:33.666165+00:00 app[web.1]:   This poses a security threat. It is strongly recommended that you 
2013-08-21T22:25:33.666165+00:00 app[web.1]:   provide a secret to prevent exploits that may be possible from crafted 
2013-08-21T22:25:33.666165+00:00 app[web.1]:   cookies. This will not be supported in future versions of Rack, and 
2013-08-21T22:25:33.666165+00:00 app[web.1]:   future versions will even invalidate your existing user cookies. 
2013-08-21T22:25:33.666165+00:00 app[web.1]:   Called from: /app/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.3/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'. 
2013-08-21T22:25:33.666165+00:00 app[web.1]: 
2013-08-21T22:25:34.000370+00:00 app[web.1]: [2013-08-21 22:25:34] INFO WEBrick::HTTPServer#start: pid=2 port=5284 
2013-08-21T22:25:34.000010+00:00 app[web.1]: [2013-08-21 22:25:33] INFO WEBrick 1.3.1 
2013-08-21T22:25:34.000010+00:00 app[web.1]: [2013-08-21 22:25:33] INFO ruby 2.0.0 (2013-06-27) [x86_64-linux] 
2013-08-21T22:25:34.121184+00:00 heroku[web.1]: State changed from starting to up 
2013-08-21T22:25:35.491396+00:00 app[web.1]: => Rails 3.2.3 application starting in production on http://0.0.0.0:5284 
2013-08-21T22:25:35.491396+00:00 app[web.1]: => Call with -d to detach 
2013-08-21T22:25:35.491396+00:00 app[web.1]: => Booting WEBrick 
2013-08-21T22:25:35.491396+00:00 app[web.1]: => Ctrl-C to shutdown server 
2013-08-21T22:25:35.491396+00:00 app[web.1]: 
2013-08-21T22:25:35.491396+00:00 app[web.1]: 
2013-08-21T22:25:35.491396+00:00 app[web.1]: Started GET "/" for 69.254.153.186 at 2013-08-21 22:25:35 +0000 
2013-08-21T22:25:35.800959+00:00 app[web.1]: Processing by StaticPagesController#home as HTML 
2013-08-21T22:25:35.808774+00:00 app[web.1]: Rendered static_pages/home.html.erb within layouts/application (2.0ms) 
2013-08-21T22:25:35.813736+00:00 app[web.1]: Rendered layouts/_shim.html.erb (0.3ms) 
2013-08-21T22:25:35.815682+00:00 app[web.1]: Rendered layouts/_header.html.erb (1.3ms) 
2013-08-21T22:25:35.817164+00:00 app[web.1]: Rendered layouts/_footer.html.erb (0.9ms) 
2013-08-21T22:25:35.817399+00:00 app[web.1]: Completed 200 OK in 16ms (Views: 15.7ms | ActiveRecord: 0.0ms) 
2013-08-21T22:25:35.821307+00:00 heroku[router]: at=info method=GET path=/ host=peaceful-sierra-3634.herokuapp.com fwd="69.254.153.186" dyno=web.1 connect=2ms service=345ms status=200 bytes=1862 
2013-08-21T22:25:36.462464+00:00 heroku[router]: at=info method=GET path=/assets/application-3428e82709d7645135002c8fadfafdc6.js host=peaceful-sierra-3634.herokuapp.com fwd="69.254.153.186" dyno=web.1 connect=2ms service=7ms status=304 bytes=0 
2013-08-21T22:25:36.825347+00:00 heroku[router]: at=info method=GET path=/assets/rails-be8732dac73d845ac5b142c8fb5f9fb0.png host=peaceful-sierra-3634.herokuapp.com fwd="69.254.153.186" dyno=web.1 connect=2ms service=15ms status=304 bytes=0 
2013-08-21T22:25:36.172492+00:00 heroku[router]: at=info method=GET path=/assets/application-7270767b2a9e9fff880aa5de378ca791.css host=peaceful-sierra-3634.herokuapp.com fwd="69.254.153.186" dyno=web.1 connect=2ms service=8ms status=304 bytes=0 

回答

0

你可能會錯過在5.4步驟?

require File.expand_path('../boot', __FILE__) 
. 
. 
. 
module SampleApp 
    class Application < Rails::Application 

    config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif) 
end 
end 
1

不知道你遵循的流程,但heroku open不是部署應用程序,這是隻有在瀏覽器中打開yourapp.herokuapp.com。

部署在Heroku上的應用程序,你必須:

  1. 創建應用程序:heroku create
  2. 使用Git,把你的代碼的Heroku:git push heroku master(Heroku的是遠程回購,使用的名稱git remote -v以確保你有heroku)。這將您的應用部署到heroku,捆綁安裝,創建數據庫和預編譯您的資產。
  3. 運行:heroku run rake db:migrate(你應該在你的Gemfile中使用MySQL或Postgres,sqlite會引發錯誤)。
  4. 最後heroku open

看起來你忘步驟3

希望這有助於!