missing required flag heroku tail - ruby-on-rails

I am working to deploy my rails app. Everything in running in local environment but I am having some issues making my first push to heroku. I am getting the standard app error, see pic:
when i run the command heroku logs --tail, i get the following error:
my gemfile is as so:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.6'
# Use sqlite3 as the database for Active Record
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
gem 'sqlite3'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
group :production do
gem 'pg'
end
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
below are my heroku logs:
2
018-02-09T00:48:11.108425+00:00 app[web.1]: from /app/vendor/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
2018-02-09T00:48:11.108427+00:00 app[web.1]: from /app/vendor/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
2018-02-09T00:48:11.108435+00:00 app[web.1]: from bin/rails:3:in `load'
2018-02-09T00:48:11.108437+00:00 app[web.1]: from bin/rails:3:in `<main>'
2018-02-09T00:48:11.120606+00:00 app[web.1]: => Booting WEBrick
2018-02-09T00:48:11.120615+00:00 app[web.1]: => Rails 4.2.6 application starting in production on http://0.0.0.0:52651
2018-02-09T00:48:11.120619+00:00 app[web.1]: => Ctrl-C to shutdown server
2018-02-09T00:48:11.120618+00:00 app[web.1]: => Run `rails server -h` for more startup options
2018-02-09T00:48:11.120621+00:00 app[web.1]: Exiting
2018-02-09T00:49:30.407211+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=postcable.herokuapp.com request_id=ec520950-df52-44ee-95aa-890d9ad76949 fwd="67.20.250.6" dyno= connect= service= status=503 bytes= protocol=https
2018-02-09T00:49:32.372812+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=postcable.herokuapp.com request_id=ffdb944b-9293-4d96-8986-b0af2974704c fwd="67.20.250.6" dyno= connect= service= status=503 bytes= protocol=https

First of all, to get the log error to work correctly also pass a flag for your app name as well:
heroku logs --tail --app my_heroku_app_name
Also, it seems you have nested gem groups. I am assuming you are using postgresql as your database for production so I would recommend to move pg out of development>production group like so:
gem 'pg'
group :development do
gem 'sqlite3'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
end
Then run
bundle install
Lastly, try pushing to heroku again with
git push heroku master

I solved, needed to define the PG version in my gemfile:
gem 'pg', '~> 0.18.4'

Related

Can't deploy a basic Rails app on Heroku

First of all I am a newbie with Ruby on Rails so sorry if the question seem stupid.
I am following a tutorial about Heroku for Rails app and when I run git push heroku master and go to check on the actual website, I get this message:
We're sorry, but something went wrong. If you are the application owner check the logs for more information.
When I run heroku logs in my console, I get the following:
2018-05-20T03:33:23.748800+00:00 app[api]: Enable Logplex by user xxx.romain#gmail.com
2018-05-20T03:33:23.554110+00:00 app[api]: Release v1 created by user xxx.romain#gmail.com
2018-05-20T03:33:23.748800+00:00 app[api]: Release v2 created by user xxx.romain#gmail.com
2018-05-20T03:33:23.554110+00:00 app[api]: Initial release by user xxx.romain#gmail.com
2018-05-20T03:33:46.000000+00:00 app[api]: Build started by user xxx.romain#gmail.com
2018-05-20T03:34:29.457658+00:00 app[api]: Set LANG, RACK_ENV, RAILS_ENV, RAILS_LOG_TO_STDOUT, RAILS_SERVE_STATIC_FILES, SECRET_KEY_BASE config vars by user xxx.romain#gmail.com
2018-05-20T03:34:29.457658+00:00 app[api]: Release v3 created by user xxx.romain#gmail.com
2018-05-20T03:34:30.828730+00:00 app[api]: Release v4 created by user xxx.romain#gmail.com
2018-05-20T03:34:30.828730+00:00 app[api]: Attach DATABASE (#ref:postgresql-tapered-27211) by user xxx.romain#gmail.com
2018-05-20T03:34:31.131189+00:00 app[api]: Scaled to console#0:Free rake#0:Free web#1:Free worker#0:Free by user xxx.romain#gmail.com
2018-05-20T03:34:31.115804+00:00 app[api]: Release v5 created by user xxx.romain#gmail.com
2018-05-20T03:34:31.115804+00:00 app[api]: Deploy 0248e11a by user xxx.romain#gmail.com
2018-05-20T03:34:31.000000+00:00 app[api]: Build succeeded
2018-05-20T03:34:36.168184+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 57618 -e production`
2018-05-20T03:34:41.855283+00:00 app[web.1]: => Booting Puma
2018-05-20T03:34:41.855302+00:00 app[web.1]: => Rails 5.1.6 application starting in production
2018-05-20T03:34:41.855303+00:00 app[web.1]: => Run `rails server -h` for more startup options
2018-05-20T03:34:41.855305+00:00 app[web.1]: Puma starting in single mode...
2018-05-20T03:34:41.855313+00:00 app[web.1]: * Version 3.11.4 (ruby 2.3.4-p301), codename: Love Song
2018-05-20T03:34:41.855315+00:00 app[web.1]: * Min threads: 5, max threads: 5
2018-05-20T03:34:41.855316+00:00 app[web.1]: * Environment: production
2018-05-20T03:34:41.855503+00:00 app[web.1]: * Listening on tcp://0.0.0.0:57618
2018-05-20T03:34:41.855969+00:00 app[web.1]: Use Ctrl-C to stop
2018-05-20T03:34:42.411033+00:00 heroku[web.1]: State changed from starting to up
2018-05-20T03:34:43.450895+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1] Started GET "/" for 27.32.8.50 at 2018-05-20 03:34:43 +0000
2018-05-20T03:34:43.487004+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1] Rendering keywords/index.html.erb within layouts/application
2018-05-20T03:34:43.463124+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1] Processing by KeywordsController#index as HTML
2018-05-20T03:34:44.722888+00:00 heroku[router]: at=info method=GET path="/" host=tweetscoperm.herokuapp.com request_id=5a2cc1ab-9701-42e6-accc-2f372ff837f1 fwd="27.32.8.50" dyno=web.1 connect=1ms service=1278ms status=500 bytes=1827 protocol=https
2018-05-20T03:34:44.715829+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1] Keyword Load (2.3ms) SELECT "keywords".* FROM "keywords"
2018-05-20T03:34:44.717471+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1] Rendered keywords/index.html.erb within layouts/application (1230.3ms)
2018-05-20T03:34:44.717773+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1] Completed 500 Internal Server Error in 1254ms (ActiveRecord: 33.5ms)
2018-05-20T03:34:44.719239+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1]
2018-05-20T03:34:44.720128+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1] ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "keywords" does not exist
2018-05-20T03:34:44.720132+00:00 app[web.1]: ^
2018-05-20T03:34:44.720130+00:00 app[web.1]: LINE 1: SELECT "keywords".* FROM "keywords"
2018-05-20T03:34:44.720134+00:00 app[web.1]: : SELECT "keywords".* FROM "keywords"):
2018-05-20T03:34:44.720461+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1] 11: </thead>
2018-05-20T03:34:44.720464+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1] 12:
2018-05-20T03:34:44.720466+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1] 13: <tbody>
2018-05-20T03:34:44.720468+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1] 14: <% #keywords.each do |keyword| %>
2018-05-20T03:34:44.720469+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1] 15: <tr>
2018-05-20T03:34:44.720471+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1] 16: <td><%= keyword.word %></td>
2018-05-20T03:34:44.720473+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1] 17: <td><%= link_to 'Show', keyword %></td>
2018-05-20T03:34:44.720531+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1]
2018-05-20T03:34:44.720593+00:00 app[web.1]: [5a2cc1ab-9701-42e6-accc-2f372ff837f1] app/views/keywords/index.html.erb:14:in `_app_views_keywords_index_html_erb___2939922413078681924_23601960'
2018-05-20T03:34:45.523130+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=tweetscoperm.herokuapp.com request_id=ec46bf49-b91c-4bf2-b017-a15b4cef63a8 fwd="27.32.8.50" dyno=web.1 connect=1ms service=2ms status=200 bytes=143 protocol=https
Looking at that, I couldn't find any reason that would cause a problem.
So far, here is how my database.yml file looks like:
development:
adapter: postgresql
database: tscope_dev
pool: 5
timeout: 5000
test:
adapter: postgresql
database: tscope_test
pool: 5
timeout: 5000
production:
adapter: postgresql
database: tscope_production
pool: 5
timeout: 5000
And my gemfile:
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.6'
# Use sqlite3 as the database for Active Record
# gem 'sqlite3'
# Using PostgreSQL as DB
gem 'pg'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
gem 'rails_12factor', group: :production
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
ruby '2.3.4'
I created the databse and did the migrations and also ran bundle install as well. It is the most basic application with just one controller generated with a scaffold.
Does anybody has any idea of what could be the problem? Even the smallest tip would help me since I really don't know what to look at right now.
If you need any futher information about my code, feel free to ask.
Thanks in advance :)
EDIT
Solved this issue by running heroku run rake db:migratein the console.
Turned out I haven't ran the migration on Heroku.
This line:
ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "keywords" does not exist
suggests you haven't run your migrations on heroku.
To do that, in your console do:
heroku run rake db:migrate

Errors in Gemfile

I've cloned my app from Github but I've got errors on Gemfile. So I think, this app. is still running on heroku and it said that all up to date when I've used following commands:
git status
//On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
git push heroku
//Everything up-to-date
Also I could see output in heroku.
How to fix the error in Gemfile?
thanks.
//error as below:
There was an error parsing `Gemfile`: The `branch` option for `gem 'recaptcha'` is not allowed. Only gems with a git source can specify a branch. Bundler cannot continue.
# from /home/ubuntu/workspace/typo-1/Gemfile:46
# -------------------------------------------
# gem 'acts_as_tree_rails3'
> gem 'recaptcha', :require => 'recaptcha/rails', :branch => 'rails3'
#
//Gemfile
env = ENV["RAILS_ENV"] || 'development'
dbfile = File.expand_path("../config/database.yml", __FILE__)
#unless File.exists?(dbfile)
# raise "You need to configure config/database.yml first"
#else
# conf = YAML.load(File.read(dbfile))
# adapter = conf[env]['adapter']
# raise "You need define an adapter in your database.yml" if adapter == '' || adapter.nil?
# case adapter
# when 'sqlite3'
# gem 'sqlite3'
# when 'postgresql'
# gem 'pg'
# when 'mysql'
# gem 'sam-mysql-ruby'
# else
# raise "Don't know what gem to use for adapter #{adapter}"
# end
#end
group :production do
gem 'pg'
end
source 'https://rubygems.org'
ruby "1.9.3"
gem 'thin'
gem 'rails', '~> 3.0.10'
gem 'require_relative'
gem 'htmlentities'
gem 'json'
gem 'bluecloth', '~> 2.1'
gem 'coderay', '~> 0.9'
gem 'kaminari'
gem 'RedCloth', '~> 4.2.8'
gem 'addressable', '~> 2.1', :require => 'addressable/uri'
gem 'mini_magick', '~> 1.3.3', :require => 'mini_magick'
gem 'uuidtools', '~> 2.1.1'
gem 'flickraw-cached'
gem 'rubypants', '~> 0.2.0'
gem 'rake', '~> 0.9.2'
gem 'acts_as_list'
gem 'acts_as_tree_rails3'
gem 'recaptcha', :require => 'recaptcha/rails', :branch => 'rails3'
group :development, :test do
gem 'ruby-debug19'
gem 'factory_girl', '~> 2.2'
gem 'webrat'
gem 'rspec-rails', '~> 2.0'
gem 'simplecov', :require => false
gem 'sqlite3'
gem 'cucumber'
gem 'cucumber-rails', :require => false
gem 'cucumber-rails-training-wheels'
gem 'database_cleaner'
gem 'capybara'
end
//edited
I took off branch but got error as below when run bundle install:
bundle install
"Your Ruby version is 2.3.0, but your Gemfile specified 1.9.3"
Version 2.4 create the same error. So,I've changed to 2.3.0 - it went through until another error as below:
Results logged to
/usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/json-1.7.5/gem_make.out
An error occurred while installing json (1.7.5), and Bundler cannot continue.
Make sure that gem install json -v '1.7.5' succeeds before bundling.
//editing
I've follow the answer suggested to use the old version 1.9.2 and I be able to use command bundle install but after pushing to heroku, I've got empty page on heroku and errors as below:
//errors
2017-07-23T18:09:50.995656+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/controllers/controller.rb:181:in `load_rackup_config'
2017-07-23T18:09:50.995657+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/controllers/controller.rb:71:in `start'
2017-07-23T18:09:50.995657+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/runner.rb:187:in `run_command'
2017-07-23T18:09:50.995658+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin/runner.rb:152:in `run!'
2017-07-23T18:09:50.995659+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/bin/thin:6:in `<top (required)>'
2017-07-23T18:09:50.995659+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `load'
2017-07-23T18:09:50.995660+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `<top (required)>'
2017-07-23T18:09:51.185918+00:00 heroku[web.1]: Process exited with status 1
2017-07-23T18:09:51.200309+00:00 heroku[web.1]: State changed from starting to crashed
2017-07-23T18:09:51.845236+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=typoa.herokuapp.com request_id=7c8caa3e-8bad-4431-9da6-8ddf2f52a4d1 fwd="108.211.182.6" dyno= connect= service= status=503 bytes= protocol=https
2017-07-23T18:19:04.542770+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=typoa.herokuapp.com request_id=798e1c83-078a-4da6-b2cd-dfbf47b80687 fwd="108.211.182.6" dyno= connect= service= status=503 bytes= protocol=https
//edited
When I took off suggested line( with recaptcha), I could not see app. locally.
With this line I could see app. locally.
Errors without this line as below:
rails server -b $IP -p $PORT
=> Booting WEBrick
=> Rails 3.0.17 application starting in development on http://0.0.0.0:8080
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
home/ubuntu/workspace/typo-1/config/initializers/recaptcha.rb:1:in `<top (required)>': uninitialized constant Recaptcha (NameError)
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/railties-3.0.17/lib/rails/engine.rb:201:in `block (2 levels) in <class:Engine>'
In any cases, I could not push to heroku:
Errors as below(it recommends to use the latest version of Ruby):
Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: !
remote: ! An error occurred while installing ruby-1.9.3
remote: !
remote: ! Heroku recommends you use the latest supported Ruby version listed here:
//edit
I could not find a working app to see the solution of this problem...Error message as below:
http://typosphere.org/stable.tar.gz#
1- In reCAPTCHA project on Github there is not a branch rails3, so, remove that piece of your Gemfile.
gem 'recaptcha', :require => 'recaptcha/rails'
2- Since you are using ruby 2.2.x, and in Gemfile is 1.9.3 I suggest that you should install 1.9.3 (via rvm or via rvm or whatever you use to manage your ruby versions) in your machine and work with that in order to avoid other conflicts you may find, because you are using a legacy code.
rvm install 1.9.3
rvm use 1.9.3
now install gem bundler and after that blundle install your Gemfile
I did not get this error using Ruby 2.4.1. I did get the same error when I changed versions to 1.9.3, as specified in the Gemfile. I also don't see a branch called rails3 at the source on Github. I would try removing the branch option first.
gem 'recaptcha', require: 'recaptcha/rails'

Rails Heroku App Won't Load

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
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.

Deployed Rails 4.2.4 on heroku but can't run app

I created a Rails 4.2.4 app and deployed it to Heroku without adding any code. It runs fine on localhost but not on Heroku. Here are the Heroku logs:
at=info method=GET path="/" host=bagala.herokuapp.com request_id=b838aff9-e39b-4e32-8407-8d3e10da8117 fwd="178.91.253.104" dyno=web.1 connect=0ms service=3ms status=404 bytes=228
Note that sometimes I get status 404. It is quite strange. Have no Idea what is happening?
Here is my gemfile:
source 'https://rubygems.org'
ruby '2.2.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.4'
# Use postgresql as the database for Active Record
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
Of course you will receive error 404 because this is a fresh Rails app, you didn't add any routes to it. On development environment, Rails will show you a welcome page, but on production environment, it will be a 404 page because the application actually doesn't have any page to show to user.

Heroku:The page you were looking for doesn't exist No route matches [GET] "/"

I'm new to Rails. This question has been asked a lot but unfortunately none of the solutions provided have worked for me.
On Heroku, visiting the app URL after pushing my files with git push heroku master gives me the error:
The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved.
Here's my log:
2014-05-17T12:31:00.796904+00:00 app[web.1]: [2014-05-17 12:31:00] INFO WEBrick::HTTPServer#start done.
2014-05-17T12:31:00.796853+00:00 app[web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in `start'
2014-05-17T12:31:00.796864+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/commands/com
mands_tasks.rb:40:in `run_command!'
2014-05-17T12:31:00.796850+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-05-17T12:31:00.796866+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/commands.rb:
17:in `<top (required)>'
2014-05-17T12:31:00.796840+00:00 app[web.1]: [2014-05-17 12:31:00] FATAL SignalException: SIGTERM
2014-05-17T12:31:00.796868+00:00 app[web.1]: bin/rails:4:in `require'
2014-05-17T12:31:00.796855+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.r
b:14:in `run'
2014-05-17T12:31:00.796869+00:00 app[web.1]: bin/rails:4:in `<main>'
2014-05-17T12:31:00.796856+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:264:in
`start'
2014-05-17T12:31:00.796876+00:00 app[web.1]: [2014-05-17 12:31:00] INFO going to shutdown ...
2014-05-17T12:31:00.796858+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/commands/ser
ver.rb:69:in `start'
2014-05-17T12:31:00.796944+00:00 app[web.1]: Exiting
2014-05-17T12:31:00.796860+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-4.1.1/lib/rails/commands/com
mands_tasks.rb:81:in `block in server'
2014-05-17T12:31:00.138102+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2014-05-17T12:31:02.926026+00:00 heroku[web.1]: Process exited with status 143
Here's my Gemfile:
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.1'
# Use sqlite3 as the database for Active Record
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
gem 'rails_log_stdout', github: 'heroku/rails_log_stdout'
gem 'rails3_serve_static_assets', github: 'heroku/rails3_serve_static_assets'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]
I've also modified my production.rb by addding:
#config/environments/production.rb
config.assets.compile = true
# Heroku also requires this to be false
config.assets.initialize_on_precompile=false
and here's my routes.rb:
Rails.application.routes.draw do
exit
most of the code in this file is commented.
Please help?
Edit
O.k. so after looking at the files you have, I do not see any pages to view which means heroku has nothing to display. First off I want to recommend the ruby on rails tutorial by Micheal Hartl. You can find it free by googling "ruby on rails tutorial hartl", this will explain Ruby on rails better than I ever could, if you work through it and feel like it helped I believe you can donate some money for using it and I would recommend that because it is an amazing resource that I, and probably many others, have used to learn ruby on rails.
O.k. first why your code is not working. You have root 'welcome#index' in routes.rb. But there is no welcome_controller.rb with an 'index' action. To create that from command line type (capitaliazation is important here)
rails generate controller Welcome index
This will create an index page (the one you have in your routes file), it creates the view and the 'welcome' controller for it automatically. You can call the page anything you want but this will work for the code you already have in routes.rb. You will understand this more when you work through the tutorial. This will also create a lot of files, again the tutorial will help you understand what all that is. I am only trying to solve the issue you posted about right here and stay on topic as best I can while getting you going in the right direction.
After that you will have to push to git again and then push to heroku. When you open heroku again it should land on that page, there will not be anything on the page other than a generic message, I think you should see something along the lines of "find me in app/views/welcome/index.rb" If you see that your routing is working.

Resources