Reputation: 987
I am having troubles running my app on Heroku. The app works fine locally and gives me no errors when I push.
I am a bit of a noob but here are the logs.... what am I doing wrong exactly? A few things, I am sure ;)
Thanks!
2014-08-02T02:56:42.476683+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'
2014-08-02T02:56:42.476676+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `select'
2014-08-02T02:56:42.476694+00:00 app[web.1]: script/rails:6:in `require'
2014-08-02T02:56:42.476678+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-08-02T02:56:42.476687+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
2014-08-02T02:56:42.476686+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:268:in `start'
2014-08-02T02:56:42.476692+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
2014-08-02T02:56:42.476724+00:00 app[web.1]: [2014-08-02 02:56:42] INFO WEBrick::HTTPServer#start done.
2014-08-02T02:56:42.476702+00:00 app[web.1]: [2014-08-02 02:56:42] INFO going to shutdown ...
2014-08-02T02:56:42.476691+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
2014-08-02T02:56:45.569017+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)
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)
2014-08-02T02:56:45.568550
+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)
/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2014-08-02T02:56:46.545364+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:33203
2014-08-02T02:56:46.545366+00:00 app[web.1]: => Call with -d to detach
2014-08-02T02:56:46.545359+00:00 app[web.1]: => Booting WEBrick
2014-08-02T02:56:46.545368+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-08-02T02:56:46.545369+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2014-08-02T02:56:46.732149+00:00 app[web.1]: [2014-08-02 02:56:46] INFO WEBrick 1.3.1
2014-08-02T02:56:46.732161+00:00 app[web.1]: [2014-08-02 02:56:46] INFO ruby 2.0.0 (2014-05-08) [x86_64-linux]
2014-08-02T02:56:46.732729+00:00 app[web.1]: [2014-08-02 02:56:46] INFO WEBrick::HTTPServer#start: pid=2 port=33203
2014-08-02T02:56:43.886636+00:00 heroku[web.1]: Process exited with status 143
2014-08-02T02:56:42.010285+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2014-08-02T02:56:47.056544+00:00 heroku[web.1]: State changed from starting to up
2014-08-02T02:56:42.970420+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 33203`
2014-08-02T03:00:05.358113+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by barry.lachapelle@gmail.com
2014-08-02T03:00:09.590408+00:00 heroku[run.9409]: State changed from starting to up
2014-08-02T03:00:13.162415+00:00 heroku[run.9409]: State changed from up to complete
2014-08-02T03:00:09.290473+00:00 heroku[run.9409]: Awaiting client
2014-08-02T03:00:13.152932+00:00 heroku[run.9409]: Process exited with status 0
2014-08-02T03:00:09.342086+00:00 heroku[run.9409]: Starting process with command `bundle exec rake db:migrate`
2014-08-02T03:00:21.764691+00:00 app[web.1]: Started GET "/" for 106.147.253.226 at 2014-08-02 03:00:21 +0000
2014-08-02T03:00:22.034004+00:00 heroku[router]: at=info method=GET path="/" host=ruffbooks.herokuapp.com request_id=dc981a56-9021-454e-930f-e6a3f3715fbd fwd="106.147.253.226" dyno=web.1 connect=1ms service=279ms status=500 bytes=758
2014-08-02T03:00:22.016420+00:00 app[web.1]: Processing by StaticPagesController#index as HTML
2014-08-02T03:00:22.028108+00:00 app[web.1]: Rendered static_pages/index.html.erb within layouts/application (1.7ms)
2014-08-02T03:00:22.029621+00:00 app[web.1]:
2014-08-02T03:00:22.029623+00:00 app[web.1]: ActionView::Template::Error (defaults.js isn't precompiled):
2014-08-02T03:00:22.029625+00:00 app[web.1]: 3: <head>
2014-08-02T03:00:22.029626+00:00 app[web.1]: 4: <title><%= content_for?(:title) ? yield(:title) : "Untitled" %></title>
2014-08-02T03:00:22.029627+00:00 app[web.1]: 5: <%= stylesheet_link_tag "application" %>
2014-08-02T03:00:22.029629+00:00 app[web.1]: 6: <%= javascript_include_tag :defaults %>
2014-08-02T03:00:22.029630+00:00 app[web.1]: 7: <%= csrf_meta_tag %>
2014-08-02T03:00:22.029634+00:00 app[web.1]: app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb__347943086722083126_69894744358040'
2014-08-02T03:00:22.028117+00:00 app[web.1]: Completed 500 Internal Server Error in 11ms
2014-08-02T03:00:22.029632+00:00 app[web.1]: 8: <%= yield(:head) %>
2014-08-02T03:00:22.029635+00:00 app[web.1]:
2014-08-02T03:00:22.029637+00:00 app[web.1]:
2014-08-02T03:00:22.029633+00:00 app[web.1]: 9: </head>
2014-08-02T03:00:22.872918+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=ruffbooks.herokuapp.com request_id=06611019-6bda-4c8c-b6a2-6cfc4ce1d2fa fwd="106.147.253.226" dyno=web.1 connect=1ms service=7ms status=200 bytes=748
2014-08-02T03:03:57+00:00 heroku[slug-compiler]: Slug compilation started
2014-08-02T03:04:09+00:00 heroku[slug-compiler]: Slug compilation finished
2014-08-02T03:04:09.949182+00:00 heroku[web.1]: State changed from up to starting
2014-08-02T03:04:09.852212+00:00 heroku[api]: Deploy 1d124f1 by barry.lachapelle@gmail.com
2014-08-02T03:04:09.852373+00:00 heroku[api]: Release v28 created by barry.lachapelle@gmail.com
2014-08-02T03:04:13.359256+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'
2014-08-02T03:04:13.359228+00:00 app[web.1]: [2014-08-02 03:04:13] FATAL SignalException: SIGTERM
2014-08-02T03:04:13.359238+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `select'
2014-08-02T03:04:13.359241+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:in `start'
2014
-08-02T03:04:13.359243+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in `start'
2014-08-02T03:04:13.359259+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
2014-08-02T03:04:13.359261+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
2014-08-02T03:04:13.359240+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-08-02T03:04:13.359266+00:00 app[web.1]: script/rails:6:in `require'
2014-08-02T03:04:13.359264+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
2014-08-02T03:04:13.359258+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:268:in `start'
2014-08-02T03:04:13.359268+00:00 app[web.1]: script/rails:6:in `<main>'
2014-08-02T03:04:13.359263+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
2014-08-02T03:04:13.359453+00:00 app[web.1]: [2014-08-02 03:04:13] INFO going to shutdown ...
2014-08-02T03:04:13.359573+00:00 app[web.1]: [2014-08-02 03:04:13] INFO WEBrick::HTTPServer#start done.
2014-08-02T03:04:13.359684+00:00 app[web.1]: Exiting
2014-08-02T03:04:14.853313+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)
log.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2014-08-02T03:04:14.852857+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)
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)
2014-08-02T03:04:15.736918+00:00 app[web.1]: => Call with -d to detach
2014-08-02T03:04:15.736904+00:00 app[web.1]: => Booting WEBrick
2014-08-02T03:04:15.736921+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2014-08-02T03:04:15.812883+00:00 app[web.1]: [2014-08-02 03:04:15] INFO ruby 2.0.0 (2014-05-08) [x86_64-linux]
2014-08-02T03:04:15.736909+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:29602
2014-08-02T03:04:15.812869+00:00 app[web.1]: [2014-08-02 03:04:15] INFO WEBrick 1.3.1
2014-08-02T03:04:15.813293+00:00 app[web.1]: [2014-08-02 03:04:15] INFO WEBrick::HTTPServer#start: pid=2 port=29602
2014-08-02T03:04:15.736920+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-08-02T03:04:16.188320+00:00 heroku[web.1]: State changed from starting to up
2014-08-02T03:04:12.761970+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2014-08-02T03:04:14.640636+00:00 heroku[web.1]: Process exited with status 143
2014-08-02T03:04:12.705585+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 29602`
2014-08-02T03:04:22.615561+00:00 heroku[router]: at=info method=GET path="/" host=ruffbooks.herokuapp.com request_id=81868db3-a7e9-4d85-ac67-6ba8f1424167 fwd="106.147.253.226" dyno=web.1 connect=0ms service=104ms status=500 bytes=758
2014-08-02T03:04:22.611352+00:00 app[web.1]: 4: <title><%= content_for?(:title) ? yield(:title) : "Untitled" %></title>
2014-08-02T03:04:22.517499+00:00 app[web.1]: Started GET "/" for 106.147.253.226 at 2014-08-02 03:04:22 +0000
2014-08-02T03:04:22.611354+00:00 app[web.1]: 5: <%= stylesheet_link_tag "application" %>
2014-08-02T03:04:22.611357+00:00 app[web.1]: 7: <%= csrf_meta_tag %>
2014-08-02T03:04:22.611355+00:00 app[web.1]: 6: <%= javascript_include_tag :defaults %>
2014-08-02T03:04:22.611346+00:00 app[web.1]:
2014-08-02T03:04:22.611359+00:00 app[web.1]: 8: <%= yield(:head) %>
2014-08-02T03:04:22.605983+00:00 app[web.1]: Rendered static_pages/index.html.erb within layouts/application (1.7ms)
2014-08-02T03:04:22.611363+00:00 app[web.1]:
2014-08-02T03:04:22.611360+00:00 app[web.1]: 9: </head>
2014-08-02T03:04:22.611349+00:00 app[web.1]: ActionView::Template::Error (defaults.js isn't precompiled):
2014-08-02T03:04:22.611362+00:00 app[web.1]: app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb___3942217403030960468_70065509394080'
2014-08-02T03:04:22.611351+00:00 app[web.1]: 3: <head>
2014-08-02T03:04:22.611365+00:00 app[web.1]:
2014-08-02T03:04:22.598270+00:00 app[web.1]: Processing by StaticPagesController#index as HTML
2014-08-02T03:04:22.609526+00:00 app[web.1]: Completed 500 Internal Server Error in 11ms
2014-08-02T03:04:23.455514+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=ruffbooks.herokuapp.com request_id=f5d35eda-4dbd-4b4b-9954-27daea69e02c fwd="106.147.253.226" dyno=web.1 connect=1ms service=6ms status=200 bytes=748
Upvotes: 0
Views: 68
Reputation: 192
Please replace the following code with line 5:
and run " heroku run rake assets:precompile " this command on project path
Upvotes: 0
Reputation: 76784
To give you some more information regarding running your app on Heroku, there are two types of error you will encounter:
Heroku
Rails
These errors will show when you try and load your Heroku app (http://***.herokuapp.com
), and are relatively simple to decode.
- Rails errors occur because of your own code (typically you have a syntax error).
- Heroku errors occur because of how you've set up your Heroku environment (IE platform errors)
The difference is that if you have a Rails error, your application is running correctly on Heroku -- it just has a lot of internal issues, probably in regards to your syntax. If you see the Heroku error, it essentially means you don't have Heroku's platform setup correctly (typically no db
), meaning you'll have to work on Heroku to sort it out.
Logs
The problem you're alluding to is a Rails
issue, as you can see the details in the logs as to what the error might be. An important note is that Heroku errors will typically not report anything in your logs (but that's another story)
I would highly recommend using the LogEntries add-on:
Installing this, and then using the "real-time" functionality in the back-end will allow you to better digest the errors you're receiving. At least it helped us
--
Reading Logs is an art in itself. Typically, you'll be looking for specific "error" messages - but doing that can be quite difficult. The way I read your logs was as follows:
Upon browsing through your attachment, I found the following line:
ActionView::Template::Error (defaults.js isn't precompiled):
This should be the error (although it might be part of another). It explains that you don't have defaults.js
in your app/assets/javascripts/
folder; which Jade McGough
correctly pointed out, meant that you needed to reference the "application" JS file instead
Upvotes: 2
Reputation: 348
Use <%= javascript_include_tag "application" %>
on line 5 of your index.
Upvotes: 4