0

私はheroku/ruby/railsに非常に慣れていないと言って始めましょう。Michael Hartl による Ruby on Rails チュートリアルを実行しています。「rails s」を使用してローカル サーバーにアプリをデプロイすると、すべて正常に表示されます。ただし、アプリを heroku にプッシュして「heroku open」を使用してデプロイすると、アプリはすべてのアセットをスキップするようです。アセット パイプラインが有効になっていることを確認しましたが、アプリを任意の形式で heroku にデプロイできません。

私はherokuログを見てきましたが、唯一のエラーはFATAL SignalExceptionのようですが、それが何を指しているのかわかりません. また、Deprecation Warning が深刻かどうかを誰かが説明できれば、とてもありがたいです。

ヒロクのログ:

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
4

2 に答える 2

1

従うプロセスがheroku openわかりませんが、アプリケーションをデプロイすることではなく、ブラウザで yourapp.herokuapp.com を開くだけです。

アプリケーションを heroku にデプロイするには、次のことを行う必要があります。

  1. アプリを作成します。heroku create
  2. git を使用して、コードを heroku にプッシュしますgit push heroku master(heroku はリモート リポジトリの名前です。heroku があるgit remote -vことを確認するために使用します)。これにより、アプリが heroku にデプロイされ、バンドルがインストールされ、データベースが作成され、アセットがプリコンパイルされます。
  3. 実行: heroku run rake db:migrate(Gemfile で MySQL または Postgres を使用する必要があります。sqlite はエラーをスローします)。
  4. 最後にheroku open

手順 3 を忘れているようです。

お役に立てれば!

于 2013-08-21T23:20:05.593 に答える
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
于 2013-08-21T23:18:55.560 に答える