I'm building a simple app where a user can text a message to a number and have the message saved in my database. This is a rails app with the Twilio API as the SMS service and is deployed on Heroku.
According to the Heroku logs, it is receiving the post request from Twilio but it is not saving to the database. This issue is being very difficult to solve as the time between the post request and simply logging the message to the console is taking 45 minutes.
the route handling the request:
class MessagesController < ActionController::Base
def index
puts params["Body"]
#text = Text.create({message: params["Body"], message_date: Date.now})
#user = User.first
#user.texts.push(#text)
end
end
Heroku is saying that there's a 500 error with the post request:
2016-03-09T22:45:29.713143+00:00 heroku[router]: at=info method=POST path="/received" host=app.herokuapp.com request_id=0ec8e694-2b0d-4ac9-9312-d17182f186bd fwd="54.209.0.88" dyno=web.1 connect=43ms service=31ms status=500 bytes=1754
But then the server doesn't respond for approx 45 minutes:
2016-03-09T23:20:37.332477+00:00 heroku[web.1]: Idling
2016-03-09T23:20:37.333120+00:00 heroku[web.1]: State changed from up to down
2016-03-09T23:20:43.313455+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2016-03-09T23:20:44.849078+00:00 app[web.1]: [2016-03-09 23:20:44] FATAL SignalException: SIGTERM
2016-03-09T23:20:44.849090+00:00 app[web.1]: /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:174:in `select'
2016-03-09T23:20:44.849092+00:00 app[web.1]: /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:174:in `block in start'
2016-03-09T23:20:44.849093+00:00 app[web.1]: /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:32:in `start'
2016-03-09T23:20:44.849093+00:00 app[web.1]: /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:162:in `start'
2016-03-09T23:20:44.849094+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:34:in `run'
2016-03-09T23:20:44.849095+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:286:in `start'
2016-03-09T23:20:44.849096+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/commands/server.rb:80:in `start'
2016-03-09T23:20:44.849097+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:80:in `block in server'
2016-03-09T23:20:44.849098+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `tap'
2016-03-09T23:20:44.849098+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `server'
2016-03-09T23:20:44.849099+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
2016-03-09T23:20:44.849100+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/commands.rb:17:in `'
2016-03-09T23:20:44.849101+00:00 app[web.1]: bin/rails:9:in `require'
2016-03-09T23:20:44.849102+00:00 app[web.1]: bin/rails:9:in `'
2016-03-09T23:20:44.852841+00:00 app[web.1]: [2016-03-09 23:20:44] INFO going to shutdown ...
2016-03-09T23:20:44.852937+00:00 app[web.1]: [2016-03-09 23:20:44] INFO WEBrick::HTTPServer#start done.
2016-03-09T23:20:45.017655+00:00 app[web.1]: => Booting WEBrick
2016-03-09T23:20:45.017668+00:00 app[web.1]: => Rails 4.2.5 application starting in production on http://0.0.0.0:19472
2016-03-09T23:20:45.017671+00:00 app[web.1]: => Ctrl-C to shutdown server
2016-03-09T23:20:45.017670+00:00 app[web.1]: => Run rails server -h for more startup options
2016-03-09T23:20:45.017675+00:00 app[web.1]: This is a test
2016-03-09T23:20:45.017676+00:00 app[web.1]: Exiting
2016-03-09T23:20:45.983638+00:00 heroku[web.1]: Process exited with status 143
Additionally, Twilio is giving a 11200 HTTP retrieval failure, so we're not sure how it is eventually logging the message to our console 40 minutes later.
Any ideas as to what the problem could be? Is this a heroku error, a twilio error, or something we can fix on our own?
Thanks!
My Heroku server did that a while back, and the issue was not running heroku run rake db:migrate first. I did that, and it worked for me after long idles like this.
If you don't have a lot of info in the DB yet, you may need to reset it and try again, which this SO thread helped me with: How to empty DB in heroku
Turns out I just had a typo--
class MessagesController < ActionController::Base
should have been:
class MessagesController < ApplicationController
Related
I am doing a redirection based on a model attributes.
It works fine in local but Heroku send me a debug error when I push then finish deploy.
What is that wrong with my code below ? (from here)
2018-07-27T11:18:21.949383+00:00 app[web.1]: D, [2018-07-27T11:18:21.076083 #4] DEBUG -- : Passenger Load (1.3ms) SELECT "passengers".* FROM "passengers"
2018-07-27T11:18:21.949385+00:00 app[web.1]: Puma starting in single mode...
2018-07-27T11:18:21.949384+00:00 app[web.1]: D, [2018-07-27T11:18:21.893911 #4] DEBUG -- : Passenger Load (1.6ms) SELECT "passengers".* FROM "passengers"
2018-07-27T11:18:21.949393+00:00 app[web.1]: * Version 3.12.0 (ruby 2.4.1-p111), codename: Llamas in Pajamas
2018-07-27T11:18:21.949396+00:00 app[web.1]: * Environment: production
2018-07-27T11:18:21.949395+00:00 app[web.1]: * Min threads: 5, max threads: 5
2018-07-27T11:18:21.949532+00:00 app[web.1]: * Listening on tcp://0.0.0.0:50520
2018-07-27T11:18:21.950026+00:00 app[web.1]: Use Ctrl-C to stop
2018-07-27T11:18:22.440272+00:00 heroku[web.1]: State changed from starting to up
2018-07-27T11:21:16.609823+00:00 heroku[web.1]: Restarting
2018-07-27T11:21:16.610597+00:00 heroku[web.1]: State changed from up to starting
2018-07-27T11:21:17.485929+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-07-27T11:21:17.501136+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish
2018-07-27T11:21:17.517026+00:00 app[web.1]: Exiting
2018-07-27T11:21:17.517896+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.0/lib/puma/server.rb:430:in `close': stream closed (IOError)
2018-07-27T11:21:17.517967+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.0/lib/puma/server.rb:433:in `handle_servers'
2018-07-27T11:21:17.517939+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.0/lib/puma/server.rb:430:in `ensure in handle_servers'
2018-07-27T11:21:17.517991+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.0/lib/puma/server.rb:358:in `block in run'
2018-07-27T11:21:17.608339+00:00 heroku[web.1]: Process exited with status 1
If I try to do a db:migrate it throws
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "passengers" does not exist
LINE 1: SELECT "passengers".* FROM "passengers"
app/models/dynamic_router.rb which contains the faulty loop passenger.all.each do..end which is supposed to work ?
class DynamicRouter
def self.load
Rails.application.routes.draw do
# faulty part
Passenger.all.each do |pg|
get "/#{pg.shortcut}" => redirect("/users/sign_up?q=#{pg.id}&t=#{pg.token}")
end
#end of faulty part
end
end
def self.reload
Rails.application.routes_reloader.reload!
end
end
app/models/passenger.rb
after_save :reload_routes
def reload_routes
DynamicRouter.reload
end
config/routes.rb
Rails.application.routes.draw do
...
DynamicRouter.load
end
It was because Heroku do not accept database calls from route.config
Found the solution here
get ":shortcut" => redirect("/users/sign_up"), constraints: lambda { |request| Passenger.where(shortcut: request[:shortcut]).any? }
I just learn ruby on rails. I created two database table: trainers and tokimons. Everything works fine on local host(including database), but something went wrong on heroku.
Here is the log:
2016-10-13T21:51:16.840425+00:00 heroku[router]: at=info method=GET path="/" host=a2-tokimon.herokuapp.com request_id=2f86b075-8d64-4616-984a-304df86d9768 fwd="142.58.35.51" dyno=web.1 connect=2ms service=11ms status=500 bytes=1669
2016-10-13T21:51:16.851541+00:00 app[web.1]: Started GET "/" for 142.58.35.51 at 2016-10-13 21:51:16 +0000
2016-10-13T21:51:16.854395+00:00 app[web.1]: Processing by WelcomeController#index as HTML
2016-10-13T21:51:16.858208+00:00 app[web.1]: Rendered welcome/index.erb within layouts/application (3.1ms)
2016-10-13T21:51:16.858340+00:00 app[web.1]: Completed 500 Internal Server Error in 4ms (ActiveRecord: 2.3ms)
2016-10-13T21:51:16.859867+00:00 app[web.1]:
2016-10-13T21:51:16.859872+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "trainers" does not exist
2016-10-13T21:51:16.859873+00:00 app[web.1]: LINE 1: SELECT "trainers".* FROM "trainers"
2016-10-13T21:51:16.859874+00:00 app[web.1]: ^
2016-10-13T21:51:16.859874+00:00 app[web.1]: : SELECT "trainers".* FROM "trainers"):
2016-10-13T21:51:16.859875+00:00 app[web.1]: 51:
2016-10-13T21:51:16.859876+00:00 app[web.1]: 52:
2016-10-13T21:51:16.859877+00:00 app[web.1]: 53: <tbody>
2016-10-13T21:51:16.859877+00:00 app[web.1]: 54: <% #trainer.each do |trainer| %>
2016-10-13T21:51:16.859878+00:00 app[web.1]: 55: <tr class="<%= cycle('oddline', 'evenline') %>">
2016-10-13T21:51:16.859879+00:00 app[web.1]: 56: <td><%= trainer.pname %></td>
2016-10-13T21:51:16.859880+00:00 app[web.1]: 57: <td><%= trainer.level %></td>
2016-10-13T21:51:16.859881+00:00 app[web.1]: app/views/welcome/index.erb:54:in `_app_views_welcome_index_erb__3990380873615253162_69847032979680'
2016-10-13T21:51:16.859882+00:00 app[web.1]:
2016-10-13T21:51:16.859882+00:00 app[web.1]:
Here is a portion of trainers_controller.rb
class TrainersController < ApplicationController
before_action :set_trainer, only: [:show, :edit, :update, :destroy]
# GET /trainers
# GET /trainers.json
def index
#trainer = Trainer.all
end
Here is a portion of welcome_controller.rb
class WelcomeController < ApplicationController
# GET /welcome
def index
#trainer = Trainer.all
end
end
the line:
2016-10-13T21:51:16.859872+00:00 app[web.1]: ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "trainers" does not exist should be a hint that you have a postgres issue. Specifically that the tables are undefined.
Assuming you have heroku-cli installed, you'll need to run heroku run rake db:migrate in the console this will perform the migrations needed for Heroku.
Here is the documentation on how to get a Rails (4) app running on Heroku:
https://devcenter.heroku.com/articles/getting-started-with-rails4
And specifically here is the part about migrations:
https://devcenter.heroku.com/articles/getting-started-with-rails4#migrate-your-database
Heroku CLI documentation and installation instructions:
https://devcenter.heroku.com/articles/heroku-command-line
PG::UndefinedTable and PG::UndefinedColumn errors occur because you have not run the migrations against the production database.
You should make a habit of running heroku run rake:db:migrate after each deployment.
I'm extremely new to coding in general - so be gentle.
I'm on Chapter 3, 3.1, in the very end after creating the static_pages, home and help, by entering $ rails generate controller StaticPages home help, I cannot then navigate to the page without getting a corresponding 500 Runtime Error, which in turn Killed the running server.
The "hello" app works just fine and I've had no issues up until now.
Notes: I am following the tutorial on a Windows 7 x64, but I'm taking Hartl's recommendation to use the Cloud IDE with Git, Bitbucket, and Heroku. I did have to run Rails 4.2.1 instead of Rails 4.2.2 however due to an issue when first starting out.
What could I be doing wrong? Please let me know if I need to include any more information, this is all very new to me.
EDIT:
I checked my files again what #Rich Peck stated and theyre all the same except the Routes.rb file which only has this (which was generated by the system, I'm also omitting all # comments):
Rails.application.routes.draw do
get 'static_pages/home'
get 'static_pages/help'
root 'application#hello'
end
Ive also pulled my logs as stated by a few comments, and this is the result of the last 100 lines:
2015-10-11T21:25:49.589384+00:00 app[web.1]: => Runrails server -hfor more startup options
2015-10-11T21:25:49.589385+00:00 app[web.1]: => Ctrl-C to shutdown server
2015-10-11T21:25:49.589386+00:00 app[web.1]: Started GET "/" for 208.115.151.20 at 2015-10-11 21:25:49 +0000
2015-10-11T21:25:49.646987+00:00 app[web.1]: Processing by ApplicationController#hello as HTML
2015-10-11T21:25:49.656139+00:00 app[web.1]: Completed 200 OK in 9ms (Views: 0.8ms | ActiveRecord: 0.0ms)
2015-10-11T21:25:49.655832+00:00 app[web.1]: Rendered text template (0.0ms)
2015-10-11T21:25:49.786454+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=mysterious-journey-1439.herokuapp.com request_id=2474855b-e5c5-4db8-8b2a-83f0d6095d2d fwd="208.115.151.20" dyno=web.1 connect=0ms service=3ms status=200 bytes=228
2015-10-11T21:25:49.658965+00:00 heroku[router]: at=info method=GET path="/" host=mysterious-journey-1439.herokuapp.com request_id=e85687fc-6820-42c1-b389-4a6d8e0e2ffa fwd="208.115.151.20" dyno=web.1 connect=0ms service=73ms status=304 bytes=397
2015-10-11T21:59:04.638018+00:00 heroku[web.1]: Idling
2015-10-11T21:59:04.638730+00:00 heroku[web.1]: State changed from up to down
2015-10-11T21:59:04.639573+00:00 heroku[web.1]: State changed from down to starting
2015-10-11T21:59:06.575098+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2015-10-11T21:59:06.991420+00:00 app[web.1]: [2015-10-11 21:59:06] FATAL SignalException: SIGTERM
2015-10-11T21:59:06.991427+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:inselect'
2015-10-11T21:59:06.991429+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in block in start'
2015-10-11T21:59:06.991431+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:instart'
2015-10-11T21:59:06.991432+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in start'
2015-10-11T21:59:06.991433+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:34:inrun'
2015-10-11T21:59:06.991434+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/server.rb:286:in start'
2015-10-11T21:59:06.991436+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/server.rb:80:instart'
2015-10-11T21:59:06.991438+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:80:in block in server'
2015-10-11T21:59:06.991440+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:intap'
2015-10-11T21:59:06.991441+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in server'
2015-10-11T21:59:06.991442+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:inrun_command!'
2015-10-11T21:59:06.991443+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in <top (required)>'
2015-10-11T21:59:06.991445+00:00 app[web.1]: bin/rails:8:inrequire'
2015-10-11T21:59:06.991446+00:00 app[web.1]: bin/rails:8:in <main>'
2015-10-11T21:59:06.991478+00:00 app[web.1]: [2015-10-11 21:59:06] INFO WEBrick::HTTPServer#start done.
2015-10-11T21:59:06.991452+00:00 app[web.1]: [2015-10-11 21:59:06] INFO going to shutdown ...
2015-10-11T21:59:06.991498+00:00 app[web.1]: Exiting
2015-10-11T21:59:07.767999+00:00 heroku[web.1]: Process exited with status 143
2015-10-11T21:59:08.554265+00:00 heroku[web.1]: Starting process with commandbin/rails server -p 21794 -e production
2015-10-11T21:59:12.579369+00:00 app[web.1]: [2015-10-11 21:59:12] INFO WEBrick 1.3.1
2015-10-11T21:59:12.579406+00:00 app[web.1]: [2015-10-11 21:59:12] INFO ruby 2.0.0 (2015-04-13) [x86_64-linux]
2015-10-11T21:59:12.579784+00:00 app[web.1]: [2015-10-11 21:59:12] INFO WEBrick::HTTPServer#start: pid=3 port=21794
2015-10-11T21:59:13.087410+00:00 heroku[web.1]: State changed from starting to up
2015-10-11T22:34:07.204262+00:00 heroku[web.1]: Idling
2015-10-11T22:34:07.204981+00:00 heroku[web.1]: State changed from up to down
2015-10-11T22:34:10.871115+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2015-10-11T22:34:11.813473+00:00 app[web.1]: [2015-10-11 22:34:11] FATAL SignalException: SIGTERM
2015-10-11T22:34:11.813479+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:inselect'
2015-10-11T22:34:11.813483+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in block in start'
2015-10-11T22:34:11.813484+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:instart'
2015-10-11T22:34:11.813486+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in start'
2015-10-11T22:34:11.813487+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:34:inrun'
2015-10-11T22:34:11.813489+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/server.rb:286:in start'
2015-10-11T22:34:11.813490+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/server.rb:80:instart'
2015-10-11T22:34:11.813492+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:80:in block in server'
2015-10-11T22:34:11.813493+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:intap'
2015-10-11T22:34:11.813495+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in server'
2015-10-11T22:34:11.813497+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:inrun_command!'
2015-10-11T22:34:11.813498+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in <top (required)>'
2015-10-11T22:34:11.813500+00:00 app[web.1]: bin/rails:8:inrequire'
2015-10-11T22:34:11.813501+00:00 app[web.1]: bin/rails:8:in <main>'
2015-10-11T22:34:11.813508+00:00 app[web.1]: [2015-10-11 22:34:11] INFO going to shutdown ...
2015-10-11T22:34:11.813551+00:00 app[web.1]: [2015-10-11 22:34:11] INFO WEBrick::HTTPServer#start done.
2015-10-11T22:34:11.813591+00:00 app[web.1]: => Booting WEBrick
2015-10-11T22:34:11.813594+00:00 app[web.1]: => Runrails server -hfor more startup options
2015-10-11T22:34:11.813593+00:00 app[web.1]: => Rails 4.2.1 application starting in production on http://0.0.0.0:21794
2015-10-11T22:34:11.813598+00:00 app[web.1]: Exiting
2015-10-11T22:34:11.813596+00:00 app[web.1]: => Ctrl-C to shutdown server
2015-10-11T22:34:12.863144+00:00 heroku[web.1]: Process exited with status 143
2015-10-11T22:59:27.859347+00:00 heroku[web.1]: Unidling
2015-10-11T22:59:27.859754+00:00 heroku[web.1]: State changed from down to starting
2015-10-11T22:59:31.767799+00:00 heroku[web.1]: Starting process with commandbin/rails server -p 43789 -e production
2015-10-11T22:59:35.850425+00:00 app[web.1]: [2015-10-11 22:59:35] INFO WEBrick 1.3.1
2015-10-11T22:59:35.850445+00:00 app[web.1]: [2015-10-11 22:59:35] INFO ruby 2.0.0 (2015-04-13) [x86_64-linux]
2015-10-11T22:59:35.850845+00:00 app[web.1]: [2015-10-11 22:59:35] INFO WEBrick::HTTPServer#start: pid=3 port=43789
2015-10-11T22:59:36.187808+00:00 heroku[web.1]: State changed from starting to up
2015-10-11T22:59:36.930155+00:00 app[web.1]: => Booting WEBrick
2015-10-11T22:59:36.930162+00:00 app[web.1]: => Rails 4.2.1 application starting in production on http://0.0.0.0:43789
2015-10-11T22:59:36.930163+00:00 app[web.1]: => Runrails server -hfor more startup options
2015-10-11T22:59:36.930165+00:00 app[web.1]: => Ctrl-C to shutdown server
2015-10-11T22:59:36.963421+00:00 app[web.1]: Processing by ApplicationController#hello as HTML
2015-10-11T22:59:36.930166+00:00 app[web.1]: Started GET "/" for 208.115.151.20 at 2015-10-11 22:59:36 +0000
2015-10-11T22:59:36.971478+00:00 app[web.1]: Completed 200 OK in 8ms (Views: 0.6ms | ActiveRecord: 0.0ms)
2015-10-11T22:59:36.974594+00:00 heroku[router]: at=info method=GET path="/" host=mysterious-journey-1439.herokuapp.com request_id=b8fe0c84-e45c-4997-be06-9742f276fb98 fwd="208.115.151.20" dyno=web.1 connect=1ms service=47ms status=304 bytes=397
2015-10-11T22:59:36.971195+00:00 app[web.1]: Rendered text template (0.0ms)
2015-10-11T22:59:37.155800+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=mysterious-journey-1439.herokuapp.com request_id=ce175e20-0e6c-40e1-9e4e-ec842143c159 fwd="208.115.151.20" dyno=web.1 connect=16ms service=4ms status=200 bytes=228
2015-10-11T23:35:06.014571+00:00 heroku[web.1]: Idling
2015-10-11T23:35:06.015165+00:00 heroku[web.1]: State changed from up to down
2015-10-11T23:35:08.748838+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2015-10-11T23:35:09.396823+00:00 app[web.1]: [2015-10-11 23:35:09] FATAL SignalException: SIGTERM
2015-10-11T23:35:09.396829+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:inselect'
2015-10-11T23:35:09.396831+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in block in start'
2015-10-11T23:35:09.396833+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:instart'
2015-10-11T23:35:09.396834+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in start'
2015-10-11T23:35:09.396835+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:34:inrun'
2015-10-11T23:35:09.396838+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/server.rb:80:in start'
2015-10-11T23:35:09.396836+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.6.4/lib/rack/server.rb:286:instart'
2015-10-11T23:35:09.396843+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in run_command!'
2015-10-11T23:35:09.396840+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:80:inblock in server'
2015-10-11T23:35:09.396846+00:00 app[web.1]: bin/rails:8:in require'
2015-10-11T23:35:09.396847+00:00 app[web.1]: bin/rails:8:in'
2015-10-11T23:35:09.396842+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in server'
2015-10-11T23:35:09.396841+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:intap'
2015-10-11T23:35:09.396844+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in <top (required)>'
2015-10-11T23:35:09.396853+00:00 app[web.1]: [2015-10-11 23:35:09] INFO going to shutdown ...
2015-10-11T23:35:09.396894+00:00 app[web.1]: Exiting
2015-10-11T23:35:09.396870+00:00 app[web.1]: [2015-10-11 23:35:09] INFO WEBrick::HTTPServer#start done.
2015-10-11T23:35:10.254851+00:00 heroku[web.1]: Process exited with status 143
WARNING: Toolbelt v3.42.17 update available.
I'm extremely new to coding
Because you're new, I'll give you a breakdown of how I'd debug this. It may not be an answer in itself, but it should at least help you out.
Firstly, you need to make sure you have the right controller and views set up.
The main problem for many new coders is they will blindly follow a tutorial and then be unable to understand what is being done. I know what it's like because I do it all the time (when learning something new)..
Thus, you need to understand what is being added to your app, and how it should behave:
1. Controller
Your first port of call is the controller.
You can read more about this here.
Rails will have created:
#app/controllers/static_pages_controller.rb
class StaticPagesController < ApplicationController
def hello
end
def help
end
end
This, although not strictly adhering to the CRUD setup you'll use later in Rails, should give you at least the ability to call these two actions.
You must first check if you have the above file.
2. Views
Secondly, you need to look at the views you've had generated.
These will be located at:
#app/views/static_pages/hello.html.erb
#app/views/static_pages/help.html.erb
Both of these will provide functionality to allow you to view your controller action outputs. They're not critical to the debug process at this time.
They should really have nothing inside them.
3. Routes
Finally, you want to look at your routes.
#config/routes.rb
resources :static_pages, only: [], path: "" do
collection do
get :hello #-> url.com/hello
get :help #-> url.com/help
end
end
This will give you the ability to access the controller actions, and by virtue, the views that you have just generated.
All of these should work together, without any data, to provide access to url.com/hello and url.com/help.
(source: asciicasts.com)
500 Errors are basically saying your server has an error.
What errors on the server might cause the 500 issue?
Mostly, it's due to calling variables which don't exist...
#app/views/static_pages/hello.html.erb
<%= #hello %>
If you're using Heroku, the best way to debug - as with standard Rails - is to look at the console. In standard rails, the console is visible on your screen (most of the time); with Heroku, it's slightly different.
Heroku logs are strange because they don't format very well in Windows. We tend to use LogEntries with the "live" functionality to see what's going on, and correct it:
Browsing through these logs will show you what the error is, and thus give you some perspective on how to fix it.
--
Finally, you may wish to use a gem such as better_errors or exception_handler
I'm having trouble deploying to Heroku, I've installed postgresql but I don't think I've configured it properly. This may or may not be the problem, but I have a hunch it has something to do with it. please advice.
the git for the blog: https://github.com/Apane/Blogit_blog
Updated Heroku Logs
2013-05-25T02:32:07.946326+00:00 app[web.1]: 1: <div class="right1">
2013-05-25T02:32:07.946326+00:00 app[web.1]: 2: <%= login_required class: "actions", id: "new_blog_post_link" do %>
2013-05-25T02:32:07.946326+00:00 app[web.1]: 3: <%= link_to t(:new_blog_post, scope: 'blogit.posts'), new_post_path %>
2013-05-25T02:32:07.941979+00:00 app[web.1]: Rendered blogit/posts/index.html.erb within layouts/application (91.1ms)
2013-05-25T02:32:07.946326+00:00 app[web.1]:
2013-05-25T02:32:07.946326+00:00 app[web.1]: ActionView::Template::Error (unknown attribute: name):
2013-05-25T02:32:07.946326+00:00 app[web.1]: app/controllers/application_controller.rb:5:in `current_user'
2013-05-25T02:32:07.946326+00:00 app[web.1]:
2013-05-25T02:32:07.946665+00:00 app[web.1]:
2013-05-25T02:32:07.946326+00:00 app[web.1]: app/views/blogit/posts/index.html.erb:2:in `_app_views_blogit_posts_index_html_erb__3752095678148312245_34603300'
2013-05-25T02:32:07.946326+00:00 app[web.1]: 5: </div>
2013-05-25T02:32:07.946326+00:00 app[web.1]: 4: <% end %>
2013-05-25T02:32:07.997684+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM
2013-05-25T02:32:07.997684+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL
2013-05-25T02:32:10.467911+00:00 heroku[web.1]: Process exited with status 137
2013-05-25T02:37:19.248690+00:00 heroku[slugc]: Slug compilation started
2013-05-25T02:38:02.467323+00:00 heroku[api]: Deploy de08b17 by "email"
2013-05-25T02:38:02.493201+00:00 heroku[api]: Release v9 created by "email"
2013-05-25T02:38:02.544564+00:00 heroku[api]: Deploy de08b17 by "email"
2013-05-25T02:38:03.445329+00:00 heroku[slugc]: Slug compilation finished
2013-05-25T02:38:04.208989+00:00 heroku[web.1]: State changed from up to starting
2013-05-25T02:38:06.350047+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 41915`
2013-05-25T02:38:07.613671+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2013-05-25T02:38:08.321413+00:00 app[web.1]: [2013-05-25 02:38:08] ERROR SignalException: SIGTERM
2013-05-25T02:38:08.321413+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select'
2013-05-25T02:38:15.184606+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-05-25T02:38:15.184606+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-05-25T02:38:15.187273+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-05-25T02:38:16.758556+00:00 app[web.1]: [Blogit]: Blogit::Configuration#rss_feed_language has been deprecated. You can remove this from your blogit.rb configuration file
2013-05-25T02:38:17.431528+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM
2013-05-25T02:38:17.431823+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL
2013-05-25T02:38:18.932239+00:00 app[web.1]: [2013-05-25 02:38:18] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux]
2013-05-25T02:38:18.932504+00:00 app[web.1]: [2013-05-25 02:38:18] INFO WEBrick::HTTPServer#start: pid=2 port=41915
2013-05-25T02:38:18.932239+00:00 app[web.1]: [2013-05-25 02:38:18] INFO WEBrick 1.3.1
2013-05-25T02:38:19.138465+00:00 heroku[web.1]: State changed from starting to up
2013-05-25T02:38:19.286419+00:00 heroku[web.1]: Process exited with status 137
2013-05-25T02:38:24.702435+00:00 app[web.1]: Started GET "/" for 99.233.170.104 at 2013-05-25 02:38:24 +0000
2013-05-25T02:38:24.702435+00:00 app[web.1]: => Call with -d to detach
2013-05-25T02:38:24.702435+00:00 app[web.1]: => Booting WEBrick
2013-05-25T02:38:24.702435+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:41915
2013-05-25T02:38:24.702435+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-05-25T02:38:24.865680+00:00 app[web.1]: Processing by Blogit::PostsController#index as HTML
2013-05-25T02:38:25.061058+00:00 app[web.1]: Rendered blogit/posts/index.html.erb within layouts/application (130.6ms)
2013-05-25T02:38:25.061376+00:00 app[web.1]: Completed 500 Internal Server Error in 196ms
2013-05-25T02:38:25.063272+00:00 app[web.1]:
2013-05-25T02:38:25.063272+00:00 app[web.1]: ActionView::Template::Error (unknown attribute: name):
2013-05-25T02:38:25.063272+00:00 app[web.1]: 1: <div class="right1">
2013-05-25T02:38:25.063092+00:00 heroku[router]: at=info method=GET path=/ host=infinite-springs-1056.herokuapp.com fwd="99.233.170.104" dyno=web.1 connect=3ms service=407ms status=500 bytes=643
2013-05-25T02:38:25.063272+00:00 app[web.1]: 2: <%= login_required class: "actions", id: "new_blog_post_link" do %>
2013-05-25T02:38:25.063272+00:00 app[web.1]: 4: <% end %>
2013-05-25T02:38:25.063585+00:00 app[web.1]:
2013-05-25T02:38:25.063272+00:00 app[web.1]: 3: <%= link_to t(:new_blog_post, scope: 'blogit.posts'), new_post_path %>
2013-05-25T02:38:25.063272+00:00 app[web.1]: 5: </div>
2013-05-25T02:38:25.063272+00:00 app[web.1]: app/views/blogit/posts/index.html.erb:2:in `_app_views_blogit_posts_index_html_erb___1859728747634219045_31435420'
2013-05-25T02:38:25.063272+00:00 app[web.1]:
2013-05-25T02:38:25.063272+00:00 app[web.1]: app/controllers/application_controller.rb:5:in `current_user'
2013-05-25T02:39:31.009984+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by "email"
2013-05-25T02:39:35.228241+00:00 heroku[run.1589]: Awaiting client
2013-05-25T02:39:35.254224+00:00 heroku[run.1589]: Starting process with command `bundle exec rake db:migrate`
2013-05-25T02:39:36.715005+00:00 heroku[run.1589]: State changed from starting to up
2013-05-25T02:39:43.583619+00:00 heroku[run.1589]: Process exited with status 0
2013-05-25T02:39:43.598693+00:00 heroku[run.1589]: State changed from up to complete
2013-05-25T02:47:44.635791+00:00 heroku[api]: Deploy 3b2c0e0 by "email"
2013-05-25T02:47:44.659753+00:00 heroku[api]: Release v10 created by "email"
2013-05-25T02:47:44.704699+00:00 heroku[api]: Deploy 3b2c0e0 by "email"
2013-05-25T02:47:45.205793+00:00 heroku[web.1]: State changed from up to starting
2013-05-25T02:47:48.591029+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 27123`
2013-05-25T02:47:49.862664+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2013-05-25T02:47:50.836497+00:00 app[web.1]: [2013-05-25 02:47:50] ERROR SignalException: SIGTERM
2013-05-25T02:47:50.836497+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select'
2013-05-25T02:47:54.610704+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-05-25T02:47:54.611109+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-05-25T02:47:54.611344+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-05-25T02:47:56.472610+00:00 app[web.1]: [Blogit]: Blogit::Configuration#rss_feed_language has been deprecated. You can remove this from your blogit.rb configuration file
2013-05-25T02:47:57.907795+00:00 app[web.1]: [2013-05-25 02:47:57] INFO WEBrick 1.3.1
2013-05-25T02:47:57.907795+00:00 app[web.1]: [2013-05-25 02:47:57] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux]
2013-05-25T02:47:57.908723+00:00 app[web.1]: [2013-05-25 02:47:57] INFO WEBrick::HTTPServer#start: pid=2 port=27123
2013-05-25T02:47:58.197066+00:00 heroku[web.1]: State changed from starting to up
2013-05-25T02:47:58.851641+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM
2013-05-25T02:47:58.851887+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL
2013-05-25T02:48:00.088867+00:00 app[web.1]: => Booting WEBrick
2013-05-25T02:48:00.088867+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:27123
2013-05-25T02:48:00.088867+00:00 app[web.1]: Started GET "/" for 99.233.170.104 at 2013-05-25 02:48:00 +0000
2013-05-25T02:48:00.088867+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-05-25T02:48:00.088867+00:00 app[web.1]: => Call with -d to detach
2013-05-25T02:48:00.290164+00:00 app[web.1]: Processing by Blogit::PostsController#index as HTML
2013-05-25T02:48:00.460839+00:00 app[web.1]: Rendered blogit/posts/index.html.erb within layouts/application (98.8ms)
2013-05-25T02:48:00.462767+00:00 app[web.1]:
2013-05-25T02:48:00.462767+00:00 app[web.1]: 1: <div class="right1">
2013-05-25T02:48:00.461055+00:00 app[web.1]: Completed 500 Internal Server Error in 171ms
2013-05-25T02:48:00.462767+00:00 app[web.1]: ActionView::Template::Error (unknown attribute: name):
2013-05-25T02:48:00.462767+00:00 app[web.1]: 4: <% end %>
2013-05-25T02:48:00.462767+00:00 app[web.1]: 3: <%= link_to t(:new_blog_post, scope: 'blogit.posts'), new_post_path %>
2013-05-25T02:48:00.462767+00:00 app[web.1]: 2: <%= login_required class: "actions", id: "new_blog_post_link" do %>
2013-05-25T02:48:00.462767+00:00 app[web.1]: 5: </div>
2013-05-25T02:48:00.462767+00:00 app[web.1]: app/controllers/application_controller.rb:5:in `current_user'
2013-05-25T02:48:00.462767+00:00 app[web.1]: app/views/blogit/posts/index.html.erb:2:in `_app_views_blogit_posts_index_html_erb___1549385033592403810_36478100'
2013-05-25T02:48:00.462767+00:00 app[web.1]:
2013-05-25T02:48:00.463077+00:00 app[web.1]:
2013-05-25T02:48:00.471980+00:00 heroku[router]: at=info method=GET path=/ host=infinite-springs-1056.herokuapp.com fwd="99.233.170.104" dyno=web.1 connect=3ms service=421ms status=500 bytes=643
2013-05-25T02:48:01.026129+00:00 heroku[web.1]: Process exited with status 137
As stated in the error logs, the problem is coming from
app/controllers/application_controller.rb:5:in `current_user'
which is
#current_user ||= User.first || User.create!(name: "APane")
You are trying to create a new row in the User table passing in a name attribute on the user table, but it doesn't exist. In your schema, user does not have a name field. You will need to generate a migration to add it.
You may want to brush up on some basic understanding of rails applications as well. The guides are very helpful.
Have you run 'heroku run rake db:migrate'? It seems like Heroku doesn't see your User model, which means it might not yet be in the database.
Here's a similar question: Heroku Postgres Error: PGError: ERROR: relation "organizations" does not exist (ActiveRecord::StatementInvalid)
Looks like you are using Webrick, I am pretty sure you should be using Thin for Heroku. Not sure if it will fix your problem though.
I noticed in your Gemfile you have a mistake with the indention of end in your :production group.
Change this
group :production do
gem 'pg'
end
to this
group :production do
gem 'pg'
end
Also, if you are using sqlite for development and postgresql for production and you are not sure about installing postgresql correctly. Do this
bundle install --without production
This will get you up and running on Heroku.
However, Heroku doesn't recommend running different databases in development and production because it can lead to hard to find bugs, etc. So it would be wise to figure out how to run postgresql in both environments soon. Hope this gets you started
This question already has answers here:
Can't deploy to heroku [heroku log included]
(4 answers)
Closed 9 years ago.
I'm having trouble deploying to Heroku, I've just fixed a postgresql error but now have an ActionView error amongst others. Not sure how to fix this one. please advice.
the git for the blog: https://github.com/Apane/Blogit_blog
Heroku Logs
2013-05-25T02:32:07.946326+00:00 app[web.1]: 1: <div class="right1">
2013-05-25T02:32:07.946326+00:00 app[web.1]: 2: <%= login_required class: "actions", id: "new_blog_post_link" do %>
2013-05-25T02:32:07.946326+00:00 app[web.1]: 3: <%= link_to t(:new_blog_post, scope: 'blogit.posts'), new_post_path %>
2013-05-25T02:32:07.941979+00:00 app[web.1]: Rendered blogit/posts/index.html.erb within layouts/application (91.1ms)
2013-05-25T02:32:07.946326+00:00 app[web.1]:
2013-05-25T02:32:07.946326+00:00 app[web.1]: ActionView::Template::Error (unknown attribute: name):
2013-05-25T02:32:07.946326+00:00 app[web.1]: app/controllers/application_controller.rb:5:in `current_user'
2013-05-25T02:32:07.946326+00:00 app[web.1]:
2013-05-25T02:32:07.946665+00:00 app[web.1]:
2013-05-25T02:32:07.946326+00:00 app[web.1]: app/views/blogit/posts/index.html.erb:2:in `_app_views_blogit_posts_index_html_erb__3752095678148312245_34603300'
2013-05-25T02:32:07.946326+00:00 app[web.1]: 5: </div>
2013-05-25T02:32:07.946326+00:00 app[web.1]: 4: <% end %>
2013-05-25T02:32:07.997684+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM
2013-05-25T02:32:07.997684+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL
2013-05-25T02:32:10.467911+00:00 heroku[web.1]: Process exited with status 137
2013-05-25T02:37:19.248690+00:00 heroku[slugc]: Slug compilation started
2013-05-25T02:38:02.467323+00:00 heroku[api]: Deploy de08b17 by "email"
2013-05-25T02:38:02.493201+00:00 heroku[api]: Release v9 created by "email"
2013-05-25T02:38:02.544564+00:00 heroku[api]: Deploy de08b17 by "email"
2013-05-25T02:38:03.445329+00:00 heroku[slugc]: Slug compilation finished
2013-05-25T02:38:04.208989+00:00 heroku[web.1]: State changed from up to starting
2013-05-25T02:38:06.350047+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 41915`
2013-05-25T02:38:07.613671+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2013-05-25T02:38:08.321413+00:00 app[web.1]: [2013-05-25 02:38:08] ERROR SignalException: SIGTERM
2013-05-25T02:38:08.321413+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select'
2013-05-25T02:38:15.184606+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-05-25T02:38:15.184606+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-05-25T02:38:15.187273+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-05-25T02:38:16.758556+00:00 app[web.1]: [Blogit]: Blogit::Configuration#rss_feed_language has been deprecated. You can remove this from your blogit.rb configuration file
2013-05-25T02:38:17.431528+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM
2013-05-25T02:38:17.431823+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL
2013-05-25T02:38:18.932239+00:00 app[web.1]: [2013-05-25 02:38:18] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux]
2013-05-25T02:38:18.932504+00:00 app[web.1]: [2013-05-25 02:38:18] INFO WEBrick::HTTPServer#start: pid=2 port=41915
2013-05-25T02:38:18.932239+00:00 app[web.1]: [2013-05-25 02:38:18] INFO WEBrick 1.3.1
2013-05-25T02:38:19.138465+00:00 heroku[web.1]: State changed from starting to up
2013-05-25T02:38:19.286419+00:00 heroku[web.1]: Process exited with status 137
2013-05-25T02:38:24.702435+00:00 app[web.1]: Started GET "/" for 99.233.170.104 at 2013-05-25 02:38:24 +0000
2013-05-25T02:38:24.702435+00:00 app[web.1]: => Call with -d to detach
2013-05-25T02:38:24.702435+00:00 app[web.1]: => Booting WEBrick
2013-05-25T02:38:24.702435+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:41915
2013-05-25T02:38:24.702435+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-05-25T02:38:24.865680+00:00 app[web.1]: Processing by Blogit::PostsController#index as HTML
2013-05-25T02:38:25.061058+00:00 app[web.1]: Rendered blogit/posts/index.html.erb within layouts/application (130.6ms)
2013-05-25T02:38:25.061376+00:00 app[web.1]: Completed 500 Internal Server Error in 196ms
2013-05-25T02:38:25.063272+00:00 app[web.1]:
2013-05-25T02:38:25.063272+00:00 app[web.1]: ActionView::Template::Error (unknown attribute: name):
2013-05-25T02:38:25.063272+00:00 app[web.1]: 1: <div class="right1">
2013-05-25T02:38:25.063092+00:00 heroku[router]: at=info method=GET path=/ host=infinite-springs-1056.herokuapp.com fwd="99.233.170.104" dyno=web.1 connect=3ms service=407ms status=500 bytes=643
2013-05-25T02:38:25.063272+00:00 app[web.1]: 2: <%= login_required class: "actions", id: "new_blog_post_link" do %>
2013-05-25T02:38:25.063272+00:00 app[web.1]: 4: <% end %>
2013-05-25T02:38:25.063585+00:00 app[web.1]:
2013-05-25T02:38:25.063272+00:00 app[web.1]: 3: <%= link_to t(:new_blog_post, scope: 'blogit.posts'), new_post_path %>
2013-05-25T02:38:25.063272+00:00 app[web.1]: 5: </div>
2013-05-25T02:38:25.063272+00:00 app[web.1]: app/views/blogit/posts/index.html.erb:2:in `_app_views_blogit_posts_index_html_erb___1859728747634219045_31435420'
2013-05-25T02:38:25.063272+00:00 app[web.1]:
2013-05-25T02:38:25.063272+00:00 app[web.1]: app/controllers/application_controller.rb:5:in `current_user'
2013-05-25T02:39:31.009984+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by "email"
2013-05-25T02:39:35.228241+00:00 heroku[run.1589]: Awaiting client
2013-05-25T02:39:35.254224+00:00 heroku[run.1589]: Starting process with command `bundle exec rake db:migrate`
2013-05-25T02:39:36.715005+00:00 heroku[run.1589]: State changed from starting to up
2013-05-25T02:39:43.583619+00:00 heroku[run.1589]: Process exited with status 0
2013-05-25T02:39:43.598693+00:00 heroku[run.1589]: State changed from up to complete
2013-05-25T02:47:44.635791+00:00 heroku[api]: Deploy 3b2c0e0 by "email"
2013-05-25T02:47:44.659753+00:00 heroku[api]: Release v10 created by "email"
2013-05-25T02:47:44.704699+00:00 heroku[api]: Deploy 3b2c0e0 by "email"
2013-05-25T02:47:45.205793+00:00 heroku[web.1]: State changed from up to starting
2013-05-25T02:47:48.591029+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 27123`
2013-05-25T02:47:49.862664+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2013-05-25T02:47:50.836497+00:00 app[web.1]: [2013-05-25 02:47:50] ERROR SignalException: SIGTERM
2013-05-25T02:47:50.836497+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select'
2013-05-25T02:47:54.610704+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-05-25T02:47:54.611109+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-05-25T02:47:54.611344+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-05-25T02:47:56.472610+00:00 app[web.1]: [Blogit]: Blogit::Configuration#rss_feed_language has been deprecated. You can remove this from your blogit.rb configuration file
2013-05-25T02:47:57.907795+00:00 app[web.1]: [2013-05-25 02:47:57] INFO WEBrick 1.3.1
2013-05-25T02:47:57.907795+00:00 app[web.1]: [2013-05-25 02:47:57] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux]
2013-05-25T02:47:57.908723+00:00 app[web.1]: [2013-05-25 02:47:57] INFO WEBrick::HTTPServer#start: pid=2 port=27123
2013-05-25T02:47:58.197066+00:00 heroku[web.1]: State changed from starting to up
2013-05-25T02:47:58.851641+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM
2013-05-25T02:47:58.851887+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL
2013-05-25T02:48:00.088867+00:00 app[web.1]: => Booting WEBrick
2013-05-25T02:48:00.088867+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:27123
2013-05-25T02:48:00.088867+00:00 app[web.1]: Started GET "/" for 99.233.170.104 at 2013-05-25 02:48:00 +0000
2013-05-25T02:48:00.088867+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-05-25T02:48:00.088867+00:00 app[web.1]: => Call with -d to detach
2013-05-25T02:48:00.290164+00:00 app[web.1]: Processing by Blogit::PostsController#index as HTML
2013-05-25T02:48:00.460839+00:00 app[web.1]: Rendered blogit/posts/index.html.erb within layouts/application (98.8ms)
2013-05-25T02:48:00.462767+00:00 app[web.1]:
2013-05-25T02:48:00.462767+00:00 app[web.1]: 1: <div class="right1">
2013-05-25T02:48:00.461055+00:00 app[web.1]: Completed 500 Internal Server Error in 171ms
2013-05-25T02:48:00.462767+00:00 app[web.1]: ActionView::Template::Error (unknown attribute: name):
2013-05-25T02:48:00.462767+00:00 app[web.1]: 4: <% end %>
2013-05-25T02:48:00.462767+00:00 app[web.1]: 3: <%= link_to t(:new_blog_post, scope: 'blogit.posts'), new_post_path %>
2013-05-25T02:48:00.462767+00:00 app[web.1]: 2: <%= login_required class: "actions", id: "new_blog_post_link" do %>
2013-05-25T02:48:00.462767+00:00 app[web.1]: 5: </div>
2013-05-25T02:48:00.462767+00:00 app[web.1]: app/controllers/application_controller.rb:5:in `current_user'
2013-05-25T02:48:00.462767+00:00 app[web.1]: app/views/blogit/posts/index.html.erb:2:in `_app_views_blogit_posts_index_html_erb___1549385033592403810_36478100'
2013-05-25T02:48:00.462767+00:00 app[web.1]:
2013-05-25T02:48:00.463077+00:00 app[web.1]:
2013-05-25T02:48:00.471980+00:00 heroku[router]: at=info method=GET path=/ host=infinite-springs-1056.herokuapp.com fwd="99.233.170.104" dyno=web.1 connect=3ms service=421ms status=500 bytes=643
2013-05-25T02:48:01.026129+00:00 heroku[web.1]: Process exited with status 137
here is your problem. In schema.rb you have
create_table "users", :force => true do |t|
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
and in User.rb you have
class User < ActiveRecord::Base
attr_accessible :name
blogs
def username
name = "Anthony Panepinto"
end
end
you need to delete the username method and run a migration to add username as an attribute of User
rails generate migration add_username_to_users username:string
then run
rake db:migrate
If you did this right your schema.rb will look like this
create_table "users", :force => true do |t|
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "username"
end
and User.rb should look like
class User < ActiveRecord::Base
attr_accessible :name
blogs
end
You want to do all this locally in the development environment to make sure everything is right before you push it to Heroku. Its easier to debug in development first rather than looking at Heroku error logs.