Failed in deploying to Heroku - ruby-on-rails

When deploying my Ruby on Rails app to heroku, I get an application error page, here
When typing heroku logs in my terminal line, I get the following information which I do not know how to process? Can anyone tell me what I need to do to solve the issue?
2016-07-11T11:12:32.333185+00:00 heroku[api]: Release v2 created by nicholas.wenzel#internsgopro.com
2016-07-11T11:12:32.333065+00:00 heroku[api]: Enable Logplex by nicholas.wenzel#internsgopro.com
2016-07-11T11:13:09.721816+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Ruby app
2016-07-11T11:13:09.721807+00:00 heroku[slug-compiler]: Slug compilation started
2016-07-11T11:17:24.819913+00:00 heroku[api]: Set LANG, RACK_ENV, RAILS_ENV, RAILS_SERVE_STATIC_FILES, SECRET_KEY_BASE config vars by nicholas.wenzel#internsgopro.com
2016-07-11T11:17:24.820006+00:00 heroku[api]: Release v3 created by nicholas.wenzel#internsgopro.com
2016-07-11T11:17:25.503120+00:00 heroku[api]: Attach DATABASE (#ref:postgresql-rectangular-14432) by nicholas.wenzel#internsgopro.com
2016-07-11T11:17:25.503211+00:00 heroku[api]: Release v4 created by nicholas.wenzel#internsgopro.com
2016-07-11T11:17:25.942507+00:00 heroku[api]: Scale to web=1 by nicholas.wenzel#internsgopro.com
2016-07-11T11:17:25.943837+00:00 heroku[api]: Release v5 created by nicholas.wenzel#internsgopro.com
2016-07-11T11:17:25.943474+00:00 heroku[api]: Deploy d12e1f4 by nicholas.wenzel#internsgopro.com
2016-07-11T11:17:26.383271+00:00 heroku[slug-compiler]: Slug compilation started
2016-07-11T11:17:26.383275+00:00 heroku[slug-compiler]: Slug compilation finished
2016-07-11T11:17:28.217297+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 40742 -e production`
2016-07-11T11:17:29.955175+00:00 app[web.1]: bash: bin/rails: No such file or directory
2016-07-11T11:17:30.862720+00:00 heroku[web.1]: Process exited with status 127
2016-07-11T11:17:30.877538+00:00 heroku[web.1]: State changed from starting to crashed
2016-07-11T11:17:30.878343+00:00 heroku[web.1]: State changed from crashed to starting
2016-07-11T11:17:33.707325+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 13244 -e production`
2016-07-11T11:17:35.968520+00:00 app[web.1]: bash: bin/rails: No such file or directory
2016-07-11T11:17:37.094194+00:00 heroku[web.1]: State changed from starting to crashed
2016-07-11T11:17:37.083048+00:00 heroku[web.1]: Process exited with status 127
2016-07-11T11:17:38.324735+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=secret-fjord-97193.herokuapp.com request_id=2fb7b183-2953-4290-a56e-cc4ab8000f5b fwd="31.179.119.186" dyno= connect= service= status=503 bytes=
2016-07-11T11:17:39.262796+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=secret-fjord-97193.herokuapp.com request_id=7a1d15d7-9ce4-44b2-ab29-3853c0223b06 fwd="31.179.119.186" dyno= connect= service= status=503 bytes=
2016-07-11T11:18:47.008968+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by nicholas.wenzel#internsgopro.com
2016-07-11T11:18:50.699273+00:00 heroku[run.8742]: Awaiting client
2016-07-11T11:18:50.745068+00:00 heroku[run.8742]: Starting process with command `bundle exec rake db:migrate`
2016-07-11T11:18:50.800462+00:00 heroku[run.8742]: State changed from starting to up
2016-07-11T11:18:57.245641+00:00 heroku[run.8742]: Process exited with status 0
2016-07-11T11:18:57.263781+00:00 heroku[run.8742]: State changed from up to complete
2016-07-11T11:19:05.165252+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=secret-fjord-97193.herokuapp.com request_id=1847e12b-66b1-44a9-8f5a-b50505aeb464 fwd="31.179.119.186" dyno= connect= service= status=503 bytes=
2016-07-11T11:19:41.487888+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=secret-fjord-97193.herokuapp.com request_id=631d71c7-d998-48d6-acd8-5ea507ba4554 fwd="31.179.119.186" dyno= connect= service= status=503 bytes=
2016-07-11T11:20:03.603738+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=secret-fjord-97193.herokuapp.com request_id=ceef2839-b13b-4794-9e17-1a87b8b344f8 fwd="31.179.119.186" dyno= connect= service= status=503 bytes=

Run rake rails:update:bin to create a bin folder that was added in rails4, then make a commit and push to Heroku. Hope this helps.

Related

Active Storage causing Rails app to fail on Heroku; works locally

I have a Rails app that works fine locally. It does not require any database. I am trying to deploy it using Heroku, but this is the only information I am getting in my logs as to why it's not working:
2018-09-14T17:27:28.074554+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=calendarizer.herokuapp.com request_id=4da3eec1-23dd-4d1a-ae8f-7b05086d20fc fwd="65.207.79.74" dyno= connect= service= status=503 bytes= protocol=https
2018-09-14T17:27:28.469113+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=calendarizer.herokuapp.com request_id=f079f20e-a9c1-4547-b563-3c2822b89e2d fwd="65.207.79.74" dyno= connect= service= status=503 bytes= protocol=https
My log level is set to DEBUG. No idea where else to look or how to tackle this problem.
EDIT:
I went back in the logs and I found this:
2018-09-14T17:37:19.872142+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.2.1/lib/active_record/dynamic_matchers.rb:22:in `method_missing': undefined method `has_one_attached' for #<Class:0x00000007a055f8> (NoMethodError)
I had not heard of ActiveStorage before now, but it's not something I'm using (at least not intentionally).
Log dump:
2018-09-14T17:46:41.000000+00:00 app[api]: Build started by user username#gmail.com
2018-09-14T17:46:59.000000+00:00 app[api]: Build failed -- check your build logs
2018-09-14T17:47:09.445004+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=calendarizer.herokuapp.com request_id=6dca7f6f-3afd-4bcd-b144-f63b85994472 fwd="65.207.79.74" dyno= connect= service= status=503 bytes= protocol=https
2018-09-14T17:47:09.792706+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=calendarizer.herokuapp.com request_id=1818345c-2dfb-4a30-ada6-65ca3bbc04ea fwd="65.207.79.74" dyno= connect= service= status=503 bytes= protocol=https
2018-09-14T17:56:48.278447+00:00 app[api]: Starting process with command `bundle exec rake db:migrate` by user username#gmail.com
2018-09-14T17:56:52.733021+00:00 heroku[run.7080]: Awaiting client
2018-09-14T17:56:52.763164+00:00 heroku[run.7080]: Starting process with command `bundle exec rake db:migrate`
2018-09-14T17:56:52.907308+00:00 heroku[run.7080]: State changed from starting to up
2018-09-14T17:57:00.092474+00:00 heroku[run.7080]: Process exited with status 1
2018-09-14T17:57:00.107737+00:00 heroku[run.7080]: State changed from up to complete
2018-09-14T17:58:27.000000+00:00 app[api]: Build started by user username#gmail.com
2018-09-14T17:58:40.000000+00:00 app[api]: Build failed -- check your build logs
2018-09-14T17:59:08.348804+00:00 app[api]: Starting process with command `bundle exec rake db:migrate` by user username#gmail.com
2018-09-14T17:59:14.334567+00:00 heroku[run.7746]: State changed from starting to up
2018-09-14T17:59:14.252562+00:00 heroku[run.7746]: Awaiting client
2018-09-14T17:59:14.278462+00:00 heroku[run.7746]: Starting process with command `bundle exec rake db:migrate`
2018-09-14T17:59:22.174620+00:00 heroku[run.7746]: Process exited with status 1
2018-09-14T17:59:22.189708+00:00 heroku[run.7746]: State changed from up to complete
2018-09-14T17:59:56.283122+00:00 app[api]: Starting process with command `bundle exec rake db:migrate` by user username#gmail.com
2018-09-14T18:00:05.530380+00:00 heroku[run.7894]: State changed from starting to up
2018-09-14T18:00:05.579669+00:00 heroku[run.7894]: Awaiting client
2018-09-14T18:00:05.633999+00:00 heroku[run.7894]: Starting process with command `bundle exec rake db:migrate`
2018-09-14T18:00:20.779574+00:00 heroku[run.7894]: State changed from up to complete
2018-09-14T18:00:20.763154+00:00 heroku[run.7894]: Process exited with status 1
2018-09-14T18:01:58.718055+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=calendarizer.herokuapp.com request_id=989475e7-affc-41a2-ade6-5cf21ce746a9 fwd="65.207.79.74" dyno= connect= service= status=503 bytes= protocol=https
2018-09-14T18:01:59.041312+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=calendarizer.herokuapp.com request_id=38c77377-2758-4a31-9219-6dcb548a5b1e fwd="65.207.79.74" dyno= connect= service= status=503 bytes= protocol=https
Heroku usually wants to see some kind of database (ie pg) to run if something is going to get saved, which I believe having ActiveRecord in your app is going to imply (even if you don't intend to use it). So you have two solutions I believe. In your dev & test environment you likely have sqlite3 as your database (you can look in your gemfile), but Heroku doesn't work with sqlite3.
Option 1:
Disable ActiveRecord in your app - Following this post: Disable Active Storage in Rails 5.2
Option 2:
Add a database to your production environment for heroku, so it's happy:
- in your gemfile see if you have a production group already
group :production do
if not add it
add in the pg gem:
gem 'pg'
So you should end up with something like this in your gemfile:
group :production do
gem 'pg'
end
Then commit and push to Heroku. You may need to restart the Dynos in Heroku, and you may need to create the database files on heroku too:
heroku run rails db:create
You should be up and running now.
For me the problem was that the adapter in database.yml was sqlite3.
So I changed the production section of config/database.yml to:
production:
adapter: postgresql
encoding: unicodeubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
database: myapp_production
username: myapp
password: <%= ENV['MYAPP_DATABASE_PASSWORD'] %>

Error when opening heroku app

I have deployed my rails app to heroku, and am now trying to open it with "heroku open", however i get the error that "An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.". These are the logs:
2017-12-26T18:40:16.269452+00:00 app[web.1]: => Booting Puma
2017-12-26T18:40:16.261939+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
2017-12-26T18:40:16.261951+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
2017-12-26T18:40:16.269455+00:00 app[web.1]: => Rails 5.1.4 application starting in production
2017-12-26T18:40:16.261978+00:00 app[web.1]: from bin/rails:9:in `require'
2017-12-26T18:40:16.269456+00:00 app[web.1]: Exiting
2017-12-26T18:40:16.269455+00:00 app[web.1]: => Run `rails server -h` for more startup options
2017-12-26T18:40:16.372189+00:00 heroku[web.1]: State changed from starting to crashed
2017-12-26T18:40:16.359435+00:00 heroku[web.1]: Process exited with status 1
2017-12-26T18:40:16.911232+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=pacific-stream-77985.herokuapp.com request_id=60caaad5-f16e-4443-8b8f-e278d41d966d fwd="2.104.49.204" dyno= connect= service= status=503 bytes= protocol=https
2017-12-26T18:40:57.610077+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=pacific-stream-77985.herokuapp.com request_id=9b3b9601-d003-49fd-8661-fd4494f84632 fwd="2.104.49.204" dyno= connect= service= status=503 bytes= protocol=https
2017-12-26T18:45:46.508705+00:00 heroku[run.1739]: Awaiting client
2017-12-26T18:45:46.560426+00:00 heroku[run.1739]: Starting process with command `rails db:migrate`
2017-12-26T18:45:46.570612+00:00 heroku[run.1739]: State changed from starting to up
2017-12-26T18:45:42.507797+00:00 app[api]: Starting process with command `rails db:migrate` by user <mymail>#gmail.com
2017-12-26T18:45:53.393255+00:00 heroku[run.1739]: Process exited with status 0
2017-12-26T18:45:53.406858+00:00 heroku[run.1739]: State changed from up to complete
2017-12-26T18:46:09.405442+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=pacific-stream-77985.herokuapp.com request_id=e38838f5-294c-45eb-a936-81f89e8fed2d fwd="2.104.49.204" dyno= connect= service= status=503 bytes= protocol=https

Heroku H10 error "App Crashed"

I'm trying to deploy my Ruby on Rails webbapp to Heroku. Locally it works just fine but when I try to run it through Heroku is gives me a H10 error HTTP status 503. I guess it's because of the bash: bundle: command not found. But even running heroku run bundle exec rails server -p $PORT doesn't work.
2016-04-26T11:35:09.570021+00:00 heroku[slug-compiler]: Slug compilation started
2016-04-26T11:35:09.570027+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Ruby app
2016-04-26T11:36:34.435961+00:00 heroku[slug-compiler]: Slug compilation started
2016-04-26T11:36:34.435967+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Ruby app
2016-04-26T11:37:06.665673+00:00 heroku[slug-compiler]: Slug compilation started
2016-04-26T11:37:06.665682+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Ruby app
2016-04-26T11:37:20.446113+00:00 heroku[slug-compiler]: Slug compilation started
2016-04-26T11:37:20.446119+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Ruby app
2016-04-26T11:37:26.534228+00:00 heroku[web.1]: State changed from crashed to starting
2016-04-26T11:37:32.239987+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 48566`
2016-04-26T11:37:34.485283+00:00 app[web.1]: bash: bundle: command not found
2016-04-26T11:37:35.145372+00:00 heroku[web.1]: Process exited with status 127
2016-04-26T11:37:35.160181+00:00 heroku[web.1]: State changed from crashed to starting
2016-04-26T11:37:35.157438+00:00 heroku[web.1]: State changed from starting to crashed
2016-04-26T11:37:40.225006+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 57613`
2016-04-26T11:37:41.536602+00:00 app[web.1]: bash: bundle: command not found
2016-04-26T11:37:42.254167+00:00 heroku[web.1]: Process exited with status 127
2016-04-26T11:37:42.273228+00:00 heroku[web.1]: State changed from starting to crashed
2016-04-26T11:37:43.433890+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=justarandomname-sandbox.herokuapp.com request_id=4570bf17-d1d5-46f8-a2fa-9b3903e5f7b8 fwd="78.128.33.2" dyno= connect= service= status=503 bytes=
2016-04-26T11:37:43.875014+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=justarandomname-sandbox.herokuapp.com request_id=bef38221-b815-42f0-bff9-a5af6ec9faef fwd="78.128.33.2" dyno= connect= service= status=503 bytes=
2016-04-26T11:37:43.928876+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=justarandomname-sandbox.herokuapp.com request_id=af6d1b23-6fca-4936-831a-8be720931110 fwd="78.128.33.2" dyno= connect= service= status=503 bytes=
2016-04-26T11:38:18.973552+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=justarandomname-sandbox.herokuapp.com request_id=bdcbfa80-b930-458c-9838-22d143092149 fwd="78.128.33.2" dyno= connect= service= status=503 bytes=
2016-04-26T11:38:30.012185+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=justarandomname-sandbox.herokuapp.com request_id=7e6af745-e613-448c-be0e-be6c14c4499e fwd="78.128.33.2" dyno= connect= service= status=503 bytes=
2016-04-26T11:38:31.797207+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=justarandomname-sandbox.herokuapp.com request_id=11006d32-abf4-481e-896e-3da3a9778902 fwd="78.128.33.2" dyno= connect= service= status=503 bytes=
2016-04-26T11:38:33.450964+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=justarandomname-sandbox.herokuapp.com request_id=731c163d-73dc-49d8-9334-96621b9afa99 fwd="78.128.33.2" dyno= connect= service= status=503 bytes=
2016-04-26T11:38:35.451317+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=justarandomname-sandbox.herokuapp.com request_id=1bf2c73c-cd8e-4b4a-a9c2-967934186c3f fwd="78.128.33.2" dyno= connect= service= status=503 bytes=
Additional info
Procfile:
web: bundle exec rails server -p $PORT
console: bundle exec rails console
Heroku config vars:
PATH => bin:vendor/bundle/ruby/2.0.0/bin:qr/qrencode-3.2.0:bin:/.bin:/usr/local/bin:/usr/bin:/bin
GEM_PATH => vendor/bundle/ruby/2.0.0
RACK_ENV => production
RAILS_ENV => production
Heroku buildpacks:
https://github.com/incaztech/heroku-buildpack-qrencode.git
I saw you have 3 problem in Gemfile:
You have defined gem 'therubyracer' under ruby clause in assets group, then you've redecrared it for production, and staging environments without clause. That is inconsistence.
You have redefine ruby version for production, and staging environments. That is mistake, thus heroku can't find out bundled gems including bundle executable.
Your log shows some records:
Your Gemfile lists the gem rails_12factor (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
That is incorrect, so to fix it remove gem 'therubyracer', '0.12.1', and gem "qrencoder","~> 1.4.1" from -*production/staging_ group, gem 'rails_12factor' from production group, and then remove ruby "2.3.0" from the same group. Then issue bundle install, next bundle update isn't required, then add resulted Gemfile, and Gemfile.lock to git repo, and commit then, just after that do git push.

H10 error, desc="App crashed" showing "Application Error" on the heroku page

I am trying to deploy my application from my desktop to heroku. But shoiwng application error on the page. Here is the display of heroku logs :
2015-05-17T14:23:16.824327+00:00 app[web.1]: Exiting
2015-05-17T14:23:16.796436+00:00 app[web.1]: from bin/rails:8:in `<main>'
2015-05-17T14:23:16.796435+00:00 app[web.1]: from bin/rails:8:in `require'
2015-05-17T14:23:17.773437+00:00 heroku[web.1]: State changed from starting to crashed
2015-05-17T14:23:17.760552+00:00 heroku[web.1]: Process exited with status 1
2015-05-17T14:23:57.689913+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=pacific-beach-3105.herokuapp.com request_id=85de2fe6-d894-4f53-a995-1285be93c58d fwd="203.110.246.22" dyno= connect= service= status=503 bytes=
2015-05-17T14:23:59.999420+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=pacific-beach-3105.herokuapp.com request_id=7384ee1f-1efc-4801-9a4a-a34a0d17f8fb fwd="203.110.246.22" dyno= connect= service= status=503 bytes=
2015-05-17T14:24:01.833524+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=pacific-beach-3105.herokuapp.com request_id=934a68f4-84e5-4259-9455-52d8f8602c06 fwd="203.110.246.22" dyno= connect= service= status=503 bytes=
2015-05-17T14:24:31.083965+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by sameerrrana#gmail.com
2015-05-17T14:24:34.043331+00:00 heroku[run.6109]: Starting process with command `bundle exec rake db:migrate`
2015-05-17T14:24:34.759590+00:00 heroku[run.6109]: State changed from starting to up
2015-05-17T14:24:38.220213+00:00 app[run.6109]: ActiveRecord::SchemaMigration Load (1.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2015-05-17T14:24:38.954062+00:00 heroku[run.6109]: State changed from up to complete
2015-05-17T14:24:38.944714+00:00 heroku[run.6109]: Process exited with status 0
2015-05-17T14:25:11.918187+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=pacific-beach-3105.herokuapp.com request_id=d5969403-490c-4da1-aa01-905bfd39b9a1 fwd="203.110.246.22" dyno= connect= service= status=503 bytes=
2015-05-17T14:34:31.213525+00:00 heroku[api]: Starting process with command `rails console` by sameerrrana#gmail.com
2015-05-17T14:34:35.566430+00:00 heroku[run.6202]: Awaiting client
2015-05-17T14:34:35.900197+00:00 heroku[run.6202]: State changed from starting to up
2015-05-17T14:35:05.572297+00:00 heroku[run.6202]: Error R13 (Attach error) -> Failed to attach to process
2015-05-17T14:35:07.029088+00:00 heroku[run.6202]: Process exited with status 128
2015-05-17T14:35:07.045904+00:00 heroku[run.6202]: State changed from up to complete
2015-05-17T14:40:45.980758+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by sameerrrana#gmail.com
2015-05-17T14:40:50.488405+00:00 heroku[run.7608]: Starting process with command `bundle exec rake db:migrate`
2015-05-17T14:40:51.155554+00:00 heroku[run.7608]: State changed from starting to up
2015-05-17T14:40:56.358175+00:00 app[run.7608]: ActiveRecord::SchemaMigration Load (2.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
2015-05-17T14:40:57.410610+00:00 heroku[run.7608]: State changed from up to complete
2015-05-17T14:40:57.396701+00:00 heroku[run.7608]: Process exited with status 0
2015-05-17T14:41:11.499509+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=pacific-beach-3105.herokuapp.com request_id=ddc2f1be-2fb0-43d6-a24d-00e9a6631be0 fwd="203.110.246.22" dyno= connect= service= status=503 bytes=
I have been to every question regarding Application error and Error H10 but can't solve it . Please help
Add this line in the Gemfile.
gem 'pg', group: :production
then
bundle install
and commit the changes to the github. And then run the command
git push heroku master

Heroku Application Error when opening Rails Tutorial Sample App

The app works perfectly in development, but it won't open in Heroku. I've executed heroku run rake db:migrate, and I have the pg gem in my Gemfile. I'm a newbie so any help interpreting the logs is greatly appreciated (see logs below Gemfile).
Gemfile
source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0
gem 'rails', '4.0.0'
gem 'bootstrap-sass', '2.3.2.0'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.1.2'
gem 'will_paginate', '3.0.4'
gem 'bootstrap-will_paginate', '0.0.9'
gem 'execjs', '1.4.0'
group :development, :test do
gem 'sqlite3', '1.3.7'
gem 'rspec-rails', '2.13.1'
# The following optional lines are part of the advanced setup.
gem 'guard-rspec', '2.5.0'
gem 'spork-rails', github: 'sporkrb/spork-rails'
gem 'guard-spork', '1.5.0'
gem 'childprocess', '0.3.6'
end
group :test do
gem 'selenium-webdriver', '2.0.0'
gem 'capybara', '2.1.0'
gem 'factory_girl_rails', '4.2.0'
gem 'cucumber-rails', '1.3.0', :require => false
gem 'database_cleaner', github: 'bmabey/database_cleaner'
# Uncomment this line on OS X.
# gem 'growl', '1.0.3'
# Uncomment these lines on Linux.
# gem 'libnotify', '0.8.0'
# Uncomment these lines on Windows.
# gem 'rb-notifu', '0.0.4'
# gem 'win32console', '1.3.2'
end
gem 'sass-rails', '4.0.0'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.0'
gem 'jquery-rails', '2.2.1'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
group :doc do
gem 'sdoc', '0.3.20', require: false
end
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
end
Heroku Logs
2013-08-07T07:20:48.191527+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-07T07:20:55.721992+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-08-07T07:20:55.721707+00:00 heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
2013-08-07T07:30:55.539343+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-07T07:30:59.366275+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 38150 -e $RAILS_ENV`
2013-08-07T07:31:00.198943+00:00 app[web.1]: bash: bin/rails: No such file or directory
2013-08-07T07:31:01.456201+00:00 heroku[web.1]: Process exited with status 127
2013-08-07T07:31:01.468706+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-07T07:31:09.462367+00:00 heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
2013-08-07T07:31:09.462587+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-08-07T07:41:32.224698+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-07T07:48:01.169884+00:00 heroku[web.1]: State changed from starting to down
2013-08-08T16:28:35+00:00 heroku[slug-compiler]: Slug compilation started
2013-08-08T16:30:21.321235+00:00 heroku[api]: Deploy 584d5dd by lionelramos#hotmail.com
2013-08-08T16:30:21.361053+00:00 heroku[api]: Release v9 created by lionelramos#hotmail.com
2013-08-08T16:30:21.408802+00:00 heroku[api]: Deploy 584d5dd by lionelramos#hotmail.com
2013-08-08T16:30:21.776973+00:00 heroku[web.1]: State changed from down to starting
2013-08-08T16:30:22+00:00 heroku[slug-compiler]: Slug compilation finished
2013-08-08T16:30:27.193957+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 54367 -e $RAILS_ENV`
2013-08-08T16:30:28.323977+00:00 app[web.1]: bash: bin/rails: No such file or directory
2013-08-08T16:30:29.641426+00:00 heroku[web.1]: Process exited with status 127
2013-08-08T16:30:29.653233+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-08T16:30:29.654038+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-08T16:30:33.329442+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 46009 -e $RAILS_ENV`
2013-08-08T16:30:33.987177+00:00 app[web.1]: bash: bin/rails: No such file or directory
2013-08-08T16:30:35.114974+00:00 heroku[web.1]: Process exited with status 127
2013-08-08T16:30:35.131772+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-08T16:30:39.524101+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:30:39.758914+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:30:43.397387+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-08-08T16:30:43.397150+00:00 heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
2013-08-08T16:31:18.425700+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:31:18.591149+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:31:28.469629+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:31:28.701988+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:32:03.650372+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:32:03.853597+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:32:48.963826+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:32:49.453647+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:33:47.304289+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:33:47.595892+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:38:29.879368+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-08T16:38:33.796829+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 8363 -e $RAILS_ENV`
2013-08-08T16:38:34.801683+00:00 app[web.1]: bash: bin/rails: No such file or directory
2013-08-08T16:38:36.319899+00:00 heroku[web.1]: Process exited with status 127
2013-08-08T16:38:36.336545+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-08T16:38:44.044665+00:00 heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
2013-08-08T16:38:44.044934+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-08-08T16:39:12.507540+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by lionelramos#hotmail.com
2013-08-08T16:39:17.159747+00:00 heroku[run.7755]: Awaiting client
2013-08-08T16:39:17.205425+00:00 heroku[run.7755]: Starting process with command `bundle exec rake db:migrate`
2013-08-08T16:39:18.501286+00:00 heroku[run.7755]: State changed from starting to up
2013-08-08T16:39:22.316247+00:00 heroku[run.7755]: State changed from up to complete
2013-08-08T16:39:22.300345+00:00 heroku[run.7755]: Process exit
ed with status 0
2013-08-08T16:39:40.520653+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-08T16:39:44.026519+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 16810 -e $RAILS_ENV`
2013-08-08T16:39:44.559308+00:00 app[web.1]: bash: bin/rails: No such file or directory
2013-08-08T16:39:45.606931+00:00 heroku[web.1]: Process exited with status 127
2013-08-08T16:39:45.623487+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-08T16:39:48.820868+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:39:49.063725+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:39:54.502024+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-08-08T16:39:54.501841+00:00 heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
2013-08-08T16:40:36.227715+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-08T16:40:40.500864+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 18671 -e $RAILS_ENV`
2013-08-08T16:40:41.165579+00:00 app[web.1]: bash: bin/rails: No such file or directory
2013-08-08T16:40:42.992519+00:00 heroku[web.1]: Proc
ess exited with status 127
2013-08-08T16:40:43.004269+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-08T16:49:52+00:00 heroku[slug-compiler]: Slug compilation started
2013-08-08T16:50:16.937021+00:00 heroku[api]: Deploy 6d2b02d by lionelramos#hotmail.com
2013-08-08T16:50:16.974839+00:00 heroku[api]: Release v10 created by lionelramos#hotmail.com
2013-08-08T16:50:17.016095+00:00 heroku[api]: Deploy 6d2b02d by lionelramos#hotmail.com
2013-08-08T16:50:17.300414+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-08T16:50:17+00:00 heroku[slug-compiler]: Slug compilation finished
2013-08-08T16:50:33.077888+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by lionelramos#hotmail.com
2013-08-08T16:50:36.009069+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 53499 -e $RAILS_ENV`
2013-08-08T16:50:36.872168+00:00 app[web.1]: bash: bin/rails: No such file or directory
2013-08-08T16:50:38.282632+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-08T16:50:38.282632+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-08T16:50:38.374822+00:00 heroku[web.1]: Process exited with status 127
2013-08-08T16:50:40.217842+00:00 heroku[run.9716]: Awaiting client
2013-08-08T16:50:40.270232+00:00 heroku[run.9716]: Starting process with command `bundle exec rake db:migrate`
2013-08-08T16:50:41.485820+00:00 heroku[run.9716]: State changed from starting to up
2013-08-08T16:50:44.073086+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 4578 -e $RAILS_ENV`
2013-08-08T16:50:45.504279+00:00 app[web.1]: bash: bin/rails: No such file or directory
2013-08-08T16:50:46.122292+00:00 heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
2013-08-08T16:50:46.122487+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-08-08T16:50:47.269304+00:00 heroku[run.9716]: State changed from up to complete
2013-08-08T16:50:47.331637+00:00 heroku[web.1]: Process exited with status 127
2013-08-08T16:50:47.348525+00:00 heroku[web.1]: State changed from starting to crashed
2013-08-08T16:50:47.251417+00:00 heroku[run.9716]: Process exited with status 0
2013-08-08T16:51:18.817119+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by lionelramos#hotmail.com
2013-08-08T16:51:25.576114+00:00 heroku[run.9125]: Awaiting client
2013-08-08T16:51:25.605481+00:00 heroku[run.9125]: Starting process with command `bundle exec rake db:migrate`
2013-08-08T16:51:27.036113+00:00 heroku[run.9125]: State changed from starting to up
2013-08-08T16:51:30.821318+00:00 heroku[run.9125]: Process exited with status 0
2013-08-08T16:51:30.838410+00:00 heroku[run.9125]: State changed from up to complete
2013-08-08T16:52:05.045633+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:52:05.283192+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:52:29.661946+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
2013-08-08T16:52:29.904570+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=safe-everglades-1070.herokuapp.com fwd="67.190.24.163" dyno= connect= service= status=503 bytes=
I think you are missing rake db:create.

Resources