0
votes

My Rails App deployed on Heroku won't load. I setup the DB + migrate and I also have puma and procfile... I literally have no clue.

Here's my logs:

2016-06-27T02:12:40.565429+00:00 heroku[web.1]: Starting process with    command `bin/rails server -p 8592 -e production`
2016-06-27T02:12:43.410912+00:00 app[web.1]: => Ctrl-C to shutdown server
2016-06-27T02:12:43.410821+00:00 app[web.1]: => Booting Puma
2016-06-27T02:12:43.410885+00:00 app[web.1]: => Rails 4.2.6 application starting in production on http://127.0.0.1:8592
2016-06-27T02:12:43.410896+00:00 app[web.1]: => Run `rails server -h` for more startup options
2016-06-27T02:12:44.269805+00:00 app[web.1]: [3] * Version 3.4.0 (ruby 2.2.4-p230), codename: Owl Bowl Brawl
2016-06-27T02:12:44.270470+00:00 app[web.1]: [3] Use Ctrl-C to stop
2016-06-27T02:12:44.269782+00:00 app[web.1]: [3] Puma starting in cluster mode...
2016-06-27T02:12:44.269807+00:00 app[web.1]: [3] * Environment: production
2016-06-27T02:12:44.269855+00:00 app[web.1]: [3] * Preloading application
2016-06-27T02:12:44.269806+00:00 app[web.1]: [3] * Min threads: 5, max threads: 5
2016-06-27T02:12:44.269840+00:00 app[web.1]: [3] * Process workers: 2
2016-06-27T02:12:44.270026+00:00 app[web.1]: [3] * Listening on tcp://127.0.0.1:8592
2016-06-27T02:12:44.276018+00:00 app[web.1]: [3] - Worker 1 (pid: 9) booted, phase: 0
2016-06-27T02:12:44.275358+00:00 app[web.1]: [3] - Worker 0 (pid: 5) booted, phase: 0
2016-06-27T02:13:12.887521+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=salty-sierra-72006.herokuapp.com request_id=e96197b0-0946-4b58-a68c-b8a9a3c3fc15 fwd="184.160.104.208" dyno= connect= service= status=503 bytes=
2016-06-27T02:13:41.028910+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-06-27T02:13:41.028910+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-06-27T02:13:41.783167+00:00 heroku[web.1]: State changed from starting to crashed
2016-06-27T02:13:41.772079+00:00 heroku[web.1]: Process exited with status 137
2016-06-27T02:13:42.941344+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=salty-sierra-72006.herokuapp.com request_id=0411e6f6-3dee-4d15-9bf2-8e069a20d9fb fwd="184.160.104.208" dyno= connect= service= status=503 bytes=
2016-06-27T02:13:43.295246+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=salty-sierra-72006.herokuapp.com request_id=e1d9e2cd-086a-4d65-9100-dc4c407c9835 fwd="184.160.104.208" dyno= connect= service= status=503 bytes=

Gemfile

source 'https://rubygems.org'


gem 'rails', '4.2.6'
gem 'pg'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'rake', '< 11'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'rails_12factor'
gem 'bootstrap-sass', '~> 3.3.6'
gem 'sass-rails', '>= 3.2'
gem 'simple_form'

gem 'twilio-ruby', '~> 4.11.1'
gem 'dotenv-rails'
gem 'puma'
gem "font-awesome-rails"

group :development, :test do
  gem 'rspec-rails', '~> 3.1.0'
  gem "factory_girl_rails",   "~> 4.7.0"
  gem "faker"
  gem "shoulda-matchers",     "~> 3.1.1"
  gem "database_cleaner",     "~> 1.4.0"
  gem "rails_best_practices", "~> 1.16.0"
  gem "rails-erd"
  gem 'annotate'
  gem 'pry-byebug'
  gem 'awesome_print'
  gem 'pry-stack_explorer'
  gem 'pry-coolline'
  gem 'pry-doc'
  gem 'pry-rails'
  gem 'pry'
  gem 'pry-macro'
  gem 'pry-state'
end

group :development do
  gem 'better_errors'
  gem "binding_of_caller"

  gem 'spring'
end

Procfile

web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}

config/puma.rb

workers Integer(ENV['WEB_CONCURRENCY'] || 2) threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 5) threads threads_count, threads_count

preload_app!

rackup      DefaultRackup
port        ENV['PORT']     || 3000
environment ENV['RACK_ENV'] || 'development'

on_worker_boot do
  # Worker specific setup for Rails 4.1+
  # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
  ActiveRecord::Base.establish_connection
end
1
This indicates that he app crashed: desc="App crashed" Have you checked the logs while it's spinning up? eg heroku tail logs -a your-app-name ?Taryn East
I'm no expert, but this also looks odd to me: http://127.0.0.1:8592 I wouldn't have thought that deploying to heroku would load something on 127.0.0.1. Have you tried contacting heroku about the issue?Taryn East
No, but I will contact themuser3100151

1 Answers

1
votes

I found the issue and it is quite simple.

1- heroku pg:reset DATABASE_URL

2- https://devcenter.heroku.com/articles/heroku-postgresql

3- Launch Heroku from your local, not your virtual box.

Working.