I am having trouble with deploying rails 3.1. app to heroku.
After some research, I found out that the main reason behind the issue is this - http://devcenter.heroku.com/articles/how-do-i-use-sqlite3-for-development
After changing my gem file:
group :production do
gem 'pg'
end
group :development, :test do
gem 'sqlite3'
end
Still the "We're sorry, but something went wrong." page error.
Here is the log file:
←[36m2011-11-26T16:34:31+00:00 heroku[api]:←[0m Add-on add logging:basic by emil
s.veveris#thrillengine.com
←[36m2011-11-26T16:34:31+00:00 heroku[api]:←[0m Release v2 created by emils.veve
ris#thrillengine.com
←[36m2011-11-26T16:34:31+00:00 heroku[api]:←[0m Add-on update shared-database
←[36m2011-11-26T16:34:31+00:00 heroku[api]:←[0m Release v3 created by emils.veve
ris#thrillengine.com
←[33m2011-11-26T16:43:15+00:00 heroku[slugc]:←[0m Slug compilation started
←[36m2011-11-26T16:44:17+00:00 heroku[api]:←[0m Deploy 277a3f4 by emils.veveris#
thrillengine.com
←[36m2011-11-26T16:44:17+00:00 heroku[api]:←[0m Release v4 created by emils.veve
ris#thrillengine.com
←[32m2011-11-26T16:44:18+00:00 heroku[web.1]:←[0m State changed from created to
starting
←[33m2011-11-26T16:44:18+00:00 heroku[slugc]:←[0m Slug compilation finished
←[32m2011-11-26T16:44:28+00:00 heroku[web.1]:←[0m State changed from starting to
up
←[35m2011-11-26T17:09:51+00:00 heroku[nginx]:←[0m 81.198.241.178 - - [26/Nov/201
1:09:09:51 -0800] "GET / HTTP/1.1" 500 728 "-" "Mozilla/5.0 (Windows NT 5.1; rv:
8.0) Gecko/20100101 Firefox/8.0" stormy-night-6239.heroku.com
←[32m2011-11-26T18:12:59+00:00 heroku[web.1]:←[0m Idling
←[32m2011-11-26T18:13:00+00:00 heroku[web.1]:←[0m State changed from up to down
←[32m2011-11-26T18:13:00+00:00 heroku[web.1]:←[0m State changed from down to cre
ated
←[32m2011-11-26T18:13:01+00:00 heroku[web.1]:←[0m State changed from created to
starting
←[32m2011-11-26T18:13:02+00:00 heroku[web.1]:←[0m Stopping process with SIGTERM
←[32m2011-11-26T18:13:02+00:00 app[web.1]:←[0m >> Stopping ...
←[32m2011-11-26T18:13:02+00:00 heroku[web.1]:←[0m Process exited
←[32m2011-11-26T18:13:11+00:00 app[web.1]:←[0m >> Thin web server (v1.2.6 codena
me Crazy Delicious)
←[32m2011-11-26T18:13:11+00:00 app[web.1]:←[0m >> Maximum connections set to 102
4
←[32m2011-11-26T18:13:11+00:00 app[web.1]:←[0m >> Listening on 0.0.0.0:29604, CT
RL+C to stop
←[32m2011-11-26T18:13:12+00:00 heroku[web.1]:←[0m State changed from starting to
up
←[32m2011-11-26T19:16:24+00:00 heroku[web.1]:←[0m Idling
←[32m2011-11-26T19:16:25+00:00 heroku[web.1]:←[0m State changed from up to down
←[32m2011-11-27T11:29:48+00:00 heroku[web.1]:←[0m Unidling
←[32m2011-11-27T11:29:48+00:00 heroku[web.1]:←[0m State changed from down to cre
ated
←[32m2011-11-27T11:29:50+00:00 heroku[web.1]:←[0m State changed from created to
starting
←[32m2011-11-27T11:29:53+00:00 heroku[web.1]:←[0m Starting process with command
`thin -p 16668 -e production -R /home/heroku_rack/heroku.ru start`
←[32m2011-11-27T11:29:59+00:00 app[web.1]:←[0m >> Thin web server (v1.2.6 codena
me Crazy Delicious)
←[32m2011-11-27T11:29:59+00:00 app[web.1]:←[0m >> Maximum connections set to 102
4
←[32m2011-11-27T11:29:59+00:00 app[web.1]:←[0m >> Listening on 0.0.0.0:16668, CT
RL+C to stop
←[32m2011-11-27T11:30:00+00:00 heroku[web.1]:←[0m State changed from starting to
up
←[31m2011-11-27T11:30:01+00:00 heroku[router]:←[0m GET stormy-night-6239.heroku.
com/ dyno=web.1 queue=0 wait=0ms service=230ms status=500 bytes=728
I don't see any errors there.
I also tried running heroku rake db:migrate
And gotthis error :
rake aborted!
An error has occurred, this and all later migrations canceled:
PGError: ERROR: column "location_id" of relation "trips" already exists
: ALTER TABLE "trips" ADD COLUMN "location_id" integer
Currently I really don't understand what do, where to look and what to change.
Everything works fine on my local machine, tough!
Thanks for any help/ROR Newbie!
UPDATE:
after heroku rake db:reset
Couldn't drop dahrzbhlza : #<ActiveRecord::StatementInvalid: PGError: ERROR: mu
st be owner of database dahrzbhlza
: DROP DATABASE IF EXISTS "dahrzbhlza">
dahrzbhlza already exists
-- create_table("categories", {:force=>true})
-> 0.0595s
-- create_table("categories_trips", {:id=>false, :force=>true})
-> 0.0031s
-- create_table("details", {:force=>true})
-> 0.0129s
-- create_table("details_trips", {:id=>false, :force=>true})
-> 0.0042s
-- create_table("images", {:force=>true})
-> 0.1982s
-- create_table("locations", {:force=>true})
-> 0.1065s
-- create_table("trips", {:force=>true})
-> 0.0422s
-- create_table("users", {:force=>true})
-> 0.1486s
-- add_index("users", ["email"], {:name=>"index_users_on_email", :unique=>true})
-> 0.0102s
-- initialize_schema_migrations_table()
-> 0.0017s
-- assume_migrated_upto_version(20111116120713, ["/app/db/migrate"])
-> 0.0091s
After heroku rake db:migrate:redo
== AddTitleToImages: reverting ===============================================
-- remove_column("images", :title)
-> 0.0058s
== AddTitleToImages: reverted (0.0059s) ======================================
== AddTitleToImages: migrating ===============================================
-- add_column(:images, :title, :string)
-> 0.0032s
== AddTitleToImages: migrated (0.0033s) ======================================
Another Question - why it is migrating only those two columns above - not all ?
another thing you'll want to do is move to the Cedar stack for Rails 3.1 sites - you're running on Bamboo from that stack trace - heroku create --stack cedar and then repush. You also won't need the rubyracer gem listed in your gemfile, it's very memory hungry and not required anymore on Cedar.
Try rebuilding the database by pushing a working copy from your local machine. You can use taps for that, like so
#On your local machine, that has a working database
$heroku db:push
Once they're the same, your migrations should start making more sense.
try this
group :production do
# gems specifically for Heroku go here
gem 'therubyracer-heroku', '0.8.1.pre3'
gem "pg"
end
Related
I looked at the other similar questions, and none of the solutions worked for me.
I'm using rails, ruby > 2.2. I precompiled my assests beforehand, and followed the steps on the heroku website for deployment.
Heroku restart or Heroku open yields the following logs
T13:23:51.140722+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=tranquil-reef-67177.herokuapp.com request_id=ddb61e34-f755-4c7b-b6e7-fbb7d2d2c545 fwd="99.99.45.37" dyno= connect= service= status=503 bytes= protocol=https
2017-08-16T13:26:09.989021+00:00 heroku[web.1]: State changed from crashed to starting 2017-08-16T13:26:12.914632+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 16431 -e production` 2017-08-16T13:26:18.084985+00:00 heroku[web.1]: Process exited with status 1
2017-08-16T13:26:17.981060+00:00 app[web.1]: 2017-08-16T13:26:17.981072+00:00 app[web.1]:
2017-08-16T13:26:17.981118+00:00 app[web.1]: >>>> A cacert.pem bundle could not be downloaded. 2017-08-16T13:26:17.981452+00:00 app[web.1]: => Booting Puma
2017-08-16T13:26:17.981454+00:00 app[web.1]: => Run `rails server -h` for more startup options 2017-08-16T13:26:17.981454+00:00 app[web.1]: => Rails 5.1.3 application starting in production on http://0.0.0.0:16431 2017-08-16T13:26:17.981457+00:00 app[web.1]: Exiting
2017-08-16T13:26:18.097040+00:00 heroku[web.1]: State changed from starting to crashed 2017-08-16T13:28:52.442323+00:00 app[api]: Starting process with command `bundle exec rake db:setup` by user smantri7#gatech.edu 2017-08-16T13:28:58.768622+00:00 heroku[run.9307]: Awaiting client
2017-08-16T13:28:58.793376+00:00 heroku[run.9307]: Starting process with command `bundle exec rake db:setup`
2017-08-16T13:28:58.977883+00:00 heroku[run.9307]: State changed from starting to up 2017-08-16T13:29:06.107123+00:00 heroku[run.9307]: State changed from up to complete
2017-08-16T13:29:06.088150+00:00 heroku[run.9307]: Process exited with status 1 2017-08-16T13:29:25.187872+00:00 heroku[run.6090]: Awaiting client
2017-08-16T13:29:25.261306+00:00 heroku[run.6090]: Starting process with command `bundle exec rake db:create`
2017-08-16T13:29:25.463655+00:00 heroku[run.6090]: State changed from starting to up 2017-08-16T13:29:21.565730+00:00 app[api]: Starting process with command `bundle exec rake db:create` by user smantri7#gatech.edu
2017-08-16T13:29:33.024076+00:00 heroku[run.6090]: State changed from up to complete
2017-08-16T13:29:33.008825+00:00 heroku[run.6090]: Process exited with status 1
2017-08-16T13:31:57.967030+00:00 app[api]: Starting process with command `bundle exec rake db:push` by user smantri7#gatech.edu
2017-08-16T13:32:01.731122+00:00 heroku[run.8862]: Awaiting client
2017-08-16T13:32:01.787259+00:00 heroku[run.8862]: Starting process with command `bundle exec rake db:push`
2017-08-16T13:32:01.976994+00:00 heroku[run.8862]: State changed from starting to up
2017-08-16T13:32:09.014212+00:00 heroku[run.8862]: State changed from up to complete
2017-08-16T13:32:08.996819+00:00 heroku[run.8862]: Process exited with status 1 2017-08-16T13:33:08.827762+00:00 heroku[web.1]: State changed from crashed to starting
2017-08-16T13:33:12.246286+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 40298 -e production`
The problem is here: >>>> A cacert.pem bundle could not be downloaded. You need to check an issue with cacert.pem
Im trying to rake my heroku app.
I ran the logs and this is what I get.
dhcp-v12-201774:staplesounds mattthomas$ heroku run rake db:migrate
Running rake db:migrate on musicfinal... up, run.2067
▸ ETIMEDOUT: connect ETIMEDOUT 50.19.103.36:5000
dhcp-v12-201774:staplesounds mattthomas$ heroku logs
2016-02-11T03:49:26.683947+00:00 heroku[api]: Enable Logplex by mattcthomas#me.com
2016-02-11T03:49:26.683947+00:00 heroku[api]: Release v2 created by mattcthomas#me.com
2016-02-11T03:50:20.892163+00:00 heroku[api]: Set LANG, RACK_ENV, RAILS_ENV, RAILS_SERVE_STATIC_FILES, SECRET_KEY_BASE config vars by mattcthomas#me.com
2016-02-11T03:50:20.892163+00:00 heroku[api]: Release v3 created by mattcthomas#me.com
2016-02-11T03:50:21.454068+00:00 heroku[api]: Attach DATABASE resource by mattcthomas#me.com
2016-02-11T03:50:21.454068+00:00 heroku[api]: Release v4 created by mattcthomas#me.com
2016-02-11T03:50:21.778790+00:00 heroku[api]: Scale to web=1 by mattcthomas#me.com
2016-02-11T03:50:21.861786+00:00 heroku[api]: Deploy fc99da3 by mattcthomas#me.com
2016-02-11T03:50:21.861786+00:00 heroku[api]: Release v5 created by mattcthomas#me.com
2016-02-11T03:50:22.235257+00:00 heroku[slug-compiler]: Slug compilation started
2016-02-11T03:50:22.235266+00:00 heroku[slug-compiler]: Slug compilation finished
2016-02-11T03:50:24.263214+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 52747 -e production`
2016-02-11T03:50:29.824709+00:00 app[web.1]: [2016-02-11 03:50:29] INFO WEBrick 1.3.1
2016-02-11T03:50:29.824725+00:00 app[web.1]: [2016-02-11 03:50:29] INFO ruby 2.2.4 (2015-12-16) [x86_64-linux]
2016-02-11T03:50:29.825057+00:00 app[web.1]: [2016-02-11 03:50:29] INFO WEBrick::HTTPServer#start: pid=3 port=52747
2016-02-11T03:50:30.076895+00:00 heroku[web.1]: State changed from starting to up
2016-02-11T03:50:31.502816+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by mattcthomas#me.com
2016-02-11T03:50:33.860069+00:00 heroku[run.5073]: Awaiting client
2016-02-11T03:50:34.290992+00:00 heroku[run.5073]: State changed from starting to up
2016-02-11T03:51:03.862924+00:00 heroku[run.5073]: Error R13 (Attach error) -> Failed to attach to process
2016-02-11T03:51:04.566425+00:00 heroku[run.5073]: State changed from up to complete
2016-02-11T03:51:04.556094+00:00 heroku[run.5073]: Process exited with status 128
2016-02-11T03:51:29.022012+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by mattcthomas#me.com
2016-02-11T03:51:34.869016+00:00 heroku[run.8794]: Starting process with command `bundle exec rake db:migrate`
2016-02-11T03:51:35.464019+00:00 heroku[run.8794]: State changed from starting to up
2016-02-11T03:51:39.975105+00:00 app[run.8794]: == 20160204020529 CreateSongs: migrating ======================================
2016-02-11T03:51:39.975125+00:00 app[run.8794]: -- create_table(:songs)
2016-02-11T03:51:39.975127+00:00 app[run.8794]: -> 0.0086s
2016-02-11T03:51:39.975127+00:00 app[run.8794]: == 20160204020529 CreateSongs: migrated (0.0087s) =============================
2016-02-11T03:51:39.975128+00:00 app[run.8794]:
2016-02-11T03:51:39.975129+00:00 app[run.8794]: == 20160205022634 ActsAsTaggableOnMigration: migrating ========================
2016-02-11T03:51:39.975130+00:00 app[run.8794]: -- create_table(:tags)
2016-02-11T03:51:39.975130+00:00 app[run.8794]: -> 0.0066s
2016-02-11T03:51:39.975131+00:00 app[run.8794]: -- create_table(:taggings)
2016-02-11T03:51:39.975131+00:00 app[run.8794]: -> 0.0099s
2016-02-11T03:51:39.975133+00:00 app[run.8794]: -- add_index(:taggings, :tag_id)
2016-02-11T03:51:39.975133+00:00 app[run.8794]: -> 0.0094s
2016-02-11T03:51:39.975134+00:00 app[run.8794]: -- add_index(:taggings, [:taggable_id, :taggable_type, :context])
2016-02-11T03:51:39.975134+00:00 app[run.8794]: -> 0.0070s
2016-02-11T03:51:39.975135+00:00 app[run.8794]: == 20160205022634 ActsAsTaggableOnMigration: migrated (0.0332s) ===============
2016-02-11T03:51:39.975135+00:00 app[run.8794]:
2016-02-11T03:51:39.975136+00:00 app[run.8794]: == 20160205022635 AddMissingUniqueIndices: migrating ==========================
2016-02-11T03:51:39.975137+00:00 app[run.8794]: -- add_index(:tags, :name, {:unique=>true})
2016-02-11T03:51:39.975138+00:00 app[run.8794]: -- remove_index(:taggings, :tag_id)
2016-02-11T03:51:39.975137+00:00 app[run.8794]: -> 0.0083s
2016-02-11T03:51:39.975138+00:00 app[run.8794]: -> 0.0030s
2016-02-11T03:51:39.975139+00:00 app[run.8794]: -- remove_index(:taggings, [:taggable_id, :taggable_type, :context])
2016-02-11T03:51:39.975140+00:00 app[run.8794]: -> 0.0053s
2016-02-11T03:51:39.975142+00:00 app[run.8794]: -> 0.0071s
2016-02-11T03:51:39.975143+00:00 app[run.8794]:
2016-02-11T03:51:39.975144+00:00 app[run.8794]: -> 0.0128s
2016-02-11T03:51:39.975142+00:00 app[run.8794]: == 20160205022635 AddMissingUniqueIndices: migrated (0.0240s) =================
2016-02-11T03:51:39.975141+00:00 app[run.8794]: -- add_index(:taggings, [:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type], {:unique=>true, :name=>"taggings_idx"})
2016-02-11T03:51:39.975143+00:00 app[run.8794]: == 20160205022636 AddTaggingsCounterCacheToTags: migrating ====================
2016-02-11T03:51:39.975146+00:00 app[run.8794]: == 20160205022637 AddMissingTaggableIndex: migrating ==========================
2016-02-11T03:51:39.975144+00:00 app[run.8794]: -- add_column(:tags, :taggings_count, :integer, {:default=>0})
2016-02-11T03:51:39.975145+00:00 app[run.8794]: == 20160205022636 AddTaggingsCounterCacheToTags: migrated (0.0351s) ===========
2016-02-11T03:51:39.975148+00:00 app[run.8794]: -> 0.0101s
2016-02-11T03:51:39.975146+00:00 app[run.8794]:
2016-02-11T03:51:39.975147+00:00 app[run.8794]: -- add_index(:taggings, [:taggable_id, :taggable_type, :context])
2016-02-11T03:51:39.975148+00:00 app[run.8794]: == 20160205022637 AddMissingTaggableIndex: migrated (0.0102s) =================
2016-02-11T03:51:39.975149+00:00 app[run.8794]: == 20160205022638 ChangeCollationForTagNames: migrating =======================
2016-02-11T03:51:39.975150+00:00 app[run.8794]:
2016-02-11T03:51:39.975150+00:00 app[run.8794]: == 20160205022638 ChangeCollationForTagNames: migrated (0.0022s) ==============
2016-02-11T03:51:39.975149+00:00 app[run.8794]:
2016-02-11T03:51:39.975151+00:00 app[run.8794]: == 20160205024602 DeviseCreateUsers: migrating ================================
2016-02-11T03:51:39.975151+00:00 app[run.8794]: -- create_table(:users)
2016-02-11T03:51:39.975152+00:00 app[run.8794]: -> 0.0269s
2016-02-11T03:51:39.975153+00:00 app[run.8794]: -- add_index(:users, :email, {:unique=>true})
2016-02-11T03:51:39.975153+00:00 app[run.8794]: -> 0.0114s
2016-02-11T03:51:39.975154+00:00 app[run.8794]: -- add_index(:users, :reset_password_token, {:unique=>true})
2016-02-11T03:51:39.975154+00:00 app[run.8794]: -> 0.0119s
2016-02-11T03:51:39.975155+00:00 app[run.8794]: == 20160205024602 DeviseCreateUsers: migrated (0.0505s) =======================
2016-02-11T03:51:39.975155+00:00 app[run.8794]:
2016-02-11T03:51:39.975156+00:00 app[run.8794]: == 20160208210640 ActsAsVotableMigration: migrating ===========================
2016-02-11T03:51:39.975156+00:00 app[run.8794]: -- create_table(:votes)
2016-02-11T03:51:39.975157+00:00 app[run.8794]: -- add_index(:votes, [:voter_id, :voter_type, :vote_scope])
2016-02-11T03:51:39.975157+00:00 app[run.8794]: -> 0.0078s
2016-02-11T03:51:39.975158+00:00 app[run.8794]: -> 0.0108s
2016-02-11T03:51:39.975158+00:00 app[run.8794]: -- add_index(:votes, [:votable_id, :votable_type, :vote_scope])
2016-02-11T03:51:39.975159+00:00 app[run.8794]: -> 0.0060s
2016-02-11T03:51:39.975159+00:00 app[run.8794]: == 20160208210640 ActsAsVotableMigration: migrated (0.0250s) ==================
2016-02-11T03:51:39.975160+00:00 app[run.8794]:
2016-02-11T03:51:40.965744+00:00 heroku[run.8794]: State changed from up to complete
2016-02-11T03:51:40.921160+00:00 heroku[run.8794]: Process exited with status 0
2016-02-11T03:54:23.806665+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by mattcthomas#me.com
2016-02-11T03:54:26.593029+00:00 heroku[run.2067]: Awaiting client
2016-02-11T03:54:27.023636+00:00 heroku[run.2067]: State changed from starting to up
2016-02-11T03:54:56.595702+00:00 heroku[run.2067]: Error R13 (Attach error) -> Failed to attach to process
2016-02-11T03:54:57.366547+00:00 heroku[run.2067]: State changed from up to complete
2016-02-11T03:54:57.351789+00:00 heroku[run.2067]: Process exited with status 128
dhcp-v12-201774:staplesounds mattthomas$
I've looked at people with the same errors and I cant seem to get it to work I've tried
dhcp-v12-201774:staplesounds mattthomas$ heroku run:detached rake db:migrate
Running `rake db:migrate` detached... up, run.8794
Use `heroku logs -p run.8794 -a musicfinal` to view the output.
dhcp-v12-201774:staplesounds mattthomas$ heroku logs
2016-02-11T03:49:26.683947+00:00 heroku[api]: Enable Logplex by mattcthomas#me.com
2016-02-11T03:49:26.683947+00:00 heroku[api]: Release v2 created by mattcthomas#me.com
2016-02-11T03:50:20.892163+00:00 heroku[api]: Set LANG, RACK_ENV, RAILS_ENV, RAILS_SERVE_STATIC_FILES, SECRET_KEY_BASE config vars by mattcthomas#me.com
2016-02-11T03:50:20.892163+00:00 heroku[api]: Release v3 created by mattcthomas#me.com
2016-02-11T03:50:21.454068+00:00 heroku[api]: Attach DATABASE resource by mattcthomas#me.com
2016-02-11T03:50:21.454068+00:00 heroku[api]: Release v4 created by mattcthomas#me.com
2016-02-11T03:50:21.778790+00:00 heroku[api]: Scale to web=1 by mattcthomas#me.com
2016-02-11T03:50:21.861786+00:00 heroku[api]: Deploy fc99da3 by mattcthomas#me.com
2016-02-11T03:50:21.861786+00:00 heroku[api]: Release v5 created by mattcthomas#me.com
2016-02-11T03:50:22.235257+00:00 heroku[slug-compiler]: Slug compilation started
2016-02-11T03:50:22.235266+00:00 heroku[slug-compiler]: Slug compilation finished
2016-02-11T03:50:24.263214+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 52747 -e production`
2016-02-11T03:50:29.824709+00:00 app[web.1]: [2016-02-11 03:50:29] INFO WEBrick 1.3.1
2016-02-11T03:50:29.824725+00:00 app[web.1]: [2016-02-11 03:50:29] INFO ruby 2.2.4 (2015-12-16) [x86_64-linux]
2016-02-11T03:50:29.825057+00:00 app[web.1]: [2016-02-11 03:50:29] INFO WEBrick::HTTPServer#start: pid=3 port=52747
2016-02-11T03:50:30.076895+00:00 heroku[web.1]: State changed from starting to up
2016-02-11T03:50:31.502816+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by mattcthomas#me.com
2016-02-11T03:50:33.860069+00:00 heroku[run.5073]: Awaiting client
2016-02-11T03:50:34.290992+00:00 heroku[run.5073]: State changed from starting to up
2016-02-11T03:51:03.862924+00:00 heroku[run.5073]: Error R13 (Attach error) -> Failed to attach to process
2016-02-11T03:51:04.566425+00:00 heroku[run.5073]: State changed from up to complete
2016-02-11T03:51:04.556094+00:00 heroku[run.5073]: Process exited with status 128
2016-02-11T03:51:29.022012+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by mattcthomas#me.com
2016-02-11T03:51:34.869016+00:00 heroku[run.8794]: Starting process with command `bundle exec rake db:migrate`
2016-02-11T03:51:35.464019+00:00 heroku[run.8794]: State changed from starting to up
Thank you so much!
Here's the github link, I'm not sure how much that helps but...
Thanks again. Sorry, I'm pretty new to rails!
It could be about your firewall issues.
Heroku docs states that: -
Timeout awaiting process The heroku run command opens a connection to
Heroku on port 5000. If your local network or ISP is blocking port
5000, or you are experiencing a connectivity issue, you will see an
error similar to: $ heroku run rails console Running rails console
attached to terminal... Timeout awaiting process You can test your
connection to Heroku by trying to connect directly to
rendezvous.runtime.heroku.com on port 5000 using telnet. A successful
session will look like this: $ telnet rendezvous.runtime.heroku.com
5000 Trying 50.19.103.36... Connected to
ec2-50-19-103-36.compute-1.amazonaws.com. Escape character is '^]'. If
you do not get this output, your computer is being blocked from
accessing our services. We recommend contacting your IT department,
ISP, or firewall manufacturer to move forward with this issue.
You can do a heroku run and then do a telnet rendezvous.runtime.heroku.com 5000 to see if your computer is blocking the connection.
I'm having the hardest time trying to deploy a rails app to Heroku.
I push the app to it and receive no errors, but when I try to access it, I receive a 'no such app' message and I can't find out why.
I've followed this steps:
1) Cloned the git repo (https://github.com/mquan/lavish) in my local machine.
2) Changed the gemfile adding a newer version of the jquery-rails (as I was receiving an error) and added the 'thin' gem as stated at heroku documentation.
3) Installed it locally and it worked (in fact, it works if I run server rails, but not if I run server rails -e production).
4) Pushed it to heroku with no errors. (I tryed to precompile the assets too to see if I had any change).
5) When I visit the page (heroku open) I receive the 'No such app' message.
As I'm absolutely new to heroku and rails, I'm just clueless about what is happening.
Thanks a ton!
Edit
The log looks like this:
2012-11-14T06:36:28+00:00 heroku[web.1]: State changed from starting to down
2012-11-14T06:36:30+00:00 heroku[web.1]: Starting process with command `bundle exec rails server thin -p 59071`
2012-11-14T06:36:35+00:00 app[web.1]: => Call with -d to detach
2012-11-14T06:36:35+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-11-14T06:36:35+00:00 app[web.1]: => Booting Thin
2012-11-14T06:36:35+00:00 app[web.1]: => Rails 3.2.0 application starting in production on http:// 0.0.0.0:59071
2012-11-14T06:36:35+00:00 app[web.1]: >> Thin web server (v1.5.0 codename Knife)
2012-11-14T06:36:35+00:00 app[web.1]: >> Maximum connections set to 1024
2012-11-14T06:36:35+00:00 app[web.1]: >> Listening on 0.0.0.0:59071, CTRL+C to stop
2012-11-14T06:36:39+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2012-11-14T06:36:40+00:00 app[web.1]: Exiting
2012-11-14T06:36:41+00:00 heroku[web.1]: Process exited with status 0
2012-11-14T20:00:11+00:00 heroku[slugc]: Slug compilation started
2012-11-14T20:01:58+00:00 heroku[slugc]: Slug compilation finished
2012-11-14T20:03:24+00:00 heroku[web.1]: Unidling
2012-11-14T20:03:24+00:00 heroku[web.1]: State changed from down to starting
2012-11-14T20:03:35+00:00 heroku[web.1]: State changed from starting to up
2012-11-14T20:03:37+00:00 heroku[router]: at=info method=GET path=/ host=blooming-castle-2034.herokuapp.com fwd= dyno=web.1 queue=0 wait=0ms connect=13ms service=909ms status=301 bytes=14
From looking at the code for Lavish, it looks like there is an initializer file that is loaded on Rails boot that redirects all non-www domain requests to www. Heroku wont work with the www prefix before your Heroku app url.
Here is a link to the file that should be removed
As a disclaimer, I'm not sure if this will have adverse effects on the Lavish application, since I've never dealt with it before.
I am new to rails and I have gone through Kevin Skoglund's Ruby on Rails 3 Essential Training course on Lynda.com. Through the course you set up a simple cms, which I did. It doesn't cover Git or deployment but I've pushed my simple cms to github (https://github.com/nick5a1/Simple_CMS) and deployed to Heroku (http://nkarrasch.herokuapp.com/).
In order to deploy to Heroku I followed the Heroku setup guide (https://devcenter.heroku.com/articles/rails3) and switched my database from MySQL to PostgreSQL. As instructed I changed gen'mysql2' to gen 'sqlite3' in my Gemfile and ran bundle install before pushing. I then ran heroku run rake db:migrate.
I'm running into 2 problems. When I try to log in (http://nkarrasch.herokuapp.com/access) I get an error "We're sorry, but something went wrong". I should instead be getting a flash message with invalid username/password combination. This is what I'm getting on my test environment on my local machine.
Secondly, when I log into the Heroku console to create and create an admin user, when I try to save that user I get the following error:
irb(main):004:0> user.save
(1.2ms) BEGIN
AdminUser Exists (1.9ms) SELECT 1 AS one FROM "admin_users" WHERE "admin_users"."username" = 'Nick5a1' LIMIT 1
(1.7ms) ROLLBACK
=> false
Any advice on how to troubleshoot would be greatly appreciated :).
Thanks very much,
Nick
EDIT: Here are my Heroku logs:
2012-06-27T20:36:44+00:00 heroku[slugc]: Slug compilation started
2012-06-27T20:37:34+00:00 heroku[api]: Add shared-database:5mb add-on by *
2012-06-27T20:37:34+00:00 heroku[api]: Release v2 created by *
2012-06-27T20:37:34+00:00 heroku[api]: Add RAILS_ENV, LANG, PATH, RACK_ENV, GEM_PATH config by *
2012-06-27T20:37:34+00:00 heroku[api]: Release v3 created by *
2012-06-27T20:37:34+00:00 heroku[api]: Release v4 created by *
2012-06-27T20:37:34+00:00 heroku[api]: Deploy 1d82839 by *
2012-06-27T20:37:35+00:00 heroku[slugc]: Slug compilation finished
2012-06-27T20:37:36+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 45450`
2012-06-27T20:37:40+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)
2012-06-27T20:37:40+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)
2012-06-27T20:37:40+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)
2012-06-27T20:37:44+00:00 app[web.1]: => Rails 3.2.6 application starting in production on http://0.0.0.0:45450
2012-06-27T20:37:44+00:00 app[web.1]: => Call with -d to detach
2012-06-27T20:37:44+00:00 app[web.1]: => Booting WEBrick
2012-06-27T20:37:44+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2012-06-27T20:37:44+00:00 app[web.1]: => Ctrl-C to shutdown server
2012-06-27T20:37:44+00:00 app[web.1]: [2012-06-27 20:37:44] INFO WEBrick 1.3.1
2012-06-27T20:37:44+00:00 app[web.1]: [2012-06-27 20:37:44] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux]
2012-06-27T20:37:44+00:00 app[web.1]: [2012-06-27 20:37:44] INFO WEBrick::HTTPServer#start: pid=2 port=45450
2012-06-27T20:37:45+00:00 heroku[web.1]: State changed from starting to up
2012-06-27T20:39:44+00:00 heroku[run.1]: Awaiting client
2012-06-27T20:39:44+00:00 heroku[run.1]: Starting process with command `bundle exec rake db:migrate`
2012-06-27T20:39:44+00:00 heroku[run.1]: State changed from starting to up
2012-06-27T20:39:51+00:00 heroku[run.1]: Process exited with status 0
2012-06-27T20:39:51+00:00 heroku[run.1]: State changed from up to complete
2012-06-27T20:41:05+00:00 heroku[run.1]: Awaiting client
2012-06-27T20:41:05+00:00 heroku[run.1]: Starting process with command `bundle exec rails console`
2012-06-27T20:41:05+00:00 heroku[run.1]: State changed from starting to up
2012-06-27T20:46:09+00:00 heroku[run.1]: Process exited with status 0
2012-06-27T20:46:09+00:00 heroku[run.1]: State changed from up to complete
You are declaring two different databases... Try removing these two lines from your Gemfile:
gem 'pg'
gem 'mysql2'
And adding the below:
group :production do
gem 'pg'
gem 'thin'
end
group :development, :test do
gem 'mysql2'
end
In this way you are defining one database to be used for development (mysql) and another one (pg) for production.
After changing the gemfile:
git add .
git commit -m "gemfile updated"
git push
git push heroku master
heroku run rake db:migrate
EDIT - looking at your routes.rb I realised that you are using the match ':controller(/:action(/:id))(.:format)', which will make all your actions available through get request. However, I have never used it and I think you might have a problem with your routes.
Jast to make sure that it is pointing to access/attempt_login, can you please include the the routes generated by:
rake routes
I have followed book until chapter 5 finished and it's working OK in my linux workstation
when I push to Heroku, all data pushed correctly but when I try to open Heroku (http://vivid-sky-685.heroku.com)
I get a 404 message.
The page you were looking for doesn't exist.
You may have mistyped the address or the page may have moved.
Below is my Gemfile for application
source 'http://rubygems.org'
gem 'rails', '3.0.5'
gem 'sqlite3'
group :development do
gem 'rspec-rails', '2.5.0'
end
group :test do
gem 'rspec', '2.5.0'
gem 'webrat', '0.7.1'
gem 'spork', '0.9.0.rc4'
end
gem 'rake','~> 0.8.7'
Any ideas what could be going wrong?
#odin here is my heroku logs , thanks
2011-09-11T10:41:57+00:00 heroku[router]: GET vivid-sky-685.heroku.com/y dyno=web.1 queue=0 wait=0ms service=5ms status=404 bytes=728
2011-09-11T10:41:57+00:00 app[web.1]:
2011-09-11T10:41:57+00:00 app[web.1]:
2011-09-11T10:41:57+00:00 app[web.1]: Started GET "/y" for 93.186.31.80 at 2011-09-11 03:41:57 -0700
2011-09-11T10:41:57+00:00 app[web.1]:
2011-09-11T10:41:57+00:00 app[web.1]: ActionController::RoutingError (No route matches "/y"):
2011-09-11T10:41:57+00:00 app[web.1]:
2011-09-11T10:41:57+00:00 app[web.1]:
2011-09-11T10:41:57+00:00 app[web.1]:
2011-09-11T10:41:57+00:00 heroku[nginx]: 93.186.31.80 - - [11/Sep/2011:03:41:57 -0700] "GET /y HTTP/1.1" 404 728 "-" "Mozilla/5.0 (BlackBerry; U; BlackBerry 9300; en) AppleWebKit/534.8+ (KHTML, like Gecko) Version/6.0.0.546 Mobile Safari/534.8+" vivid-sky-685.heroku.com
2011-09-11T11:45:28+00:00 heroku[web.1]: Idl
2011-09-11T11:45:29+00:00 heroku[web.1]: State changed from up to down
2011-09-11T11:45:29+00:00 heroku[web.1]: State changed from down to created
2011-09-11T11:45:29+00:00 heroku[web.1]: State changed from created to starting
2011-09-11T11:45:30+00:00 heroku[web.1]: Stopping process with SIGTERM
2011-09-11T11:45:30+00:00 app[web.1]: >> Stopping ...
2011-09-11T11:45:30+00:00 heroku[web.1]: Process exited
2011-09-11T11:45:30+00:00 heroku[web.1]: Starting process with command `thin -p 16738 -e production -R /home/heroku_rack/heroku.ru start`
2011-09-11T11:45:33+00:00 app[web.1]: >> Thin web server (v1.2.6 codename Crazy Delicious)
2011-09-11T11:45:33+00:00 app[web.1]: >> Maximum connections set to 1024
2011-09-11T11:45:33+00:00 app[web.1]: >> Listening on 0.0.0.0:16738, CTRL+C to stop
2011-09-11T11:45:33+00:00 heroku[web.1]: State changed from starting to up
2011-09-11T12:53:00+00:00 heroku[web.1]: Idling
2011-09-11T12:53:01+00:00 heroku[web.1]: State changed from up to down
2011-09-11T12:53:02+00:00 heroku[web.1]: Stopping process with SIGTERM
2011-09-11T12:53:02+00:00 app[web.1]: >> Stopping ...
2011-09-11T12:53:02+00:00 heroku[web.1]: Process exited
2011-09-11T13:18:21+00:00 heroku[rake.1]: State changed from created to starting
2011-09-11T13:18:23+00:00 app[rake.1]: Awaiting client
2011-09-11T13:18:23+00:00 app[rake.1]: Starting process with command `bundle exec rake db:migrate`
2011-09-11T13:18:26+00:00 heroku[rake.1]: Process exited
2011-09-11T13:18:26+00:00 heroku[rake.1]: State changed from up to complete
2011-09-11T13:20:02+00:00 heroku[web.1]: Unidling
2011-09-11T13:20:02+00:00 heroku[web.1]: State changed from down to created
2011-09-11T13:20:02+00:00 heroku[web.1]: State changed from created to starting
2011-09-11T13:20:04+00:00 heroku[web.1]: Starting process with command `thin -p 48393 -e production -R /home/heroku_rack/heroku.ru start`
2011-09-11T13:20:06+00:00 app[web.1]: >> Thin web server (v1.2.6 codename Crazy Delicious)
2011-09-11T13:20:06+00:00 app[web.1]: >> Maximum connections set to 1024
2011-09-11T13:20:06+00:00 app[web.1]: >> Listening on 0.0.0.0:48393, CTRL+C to stop
2011-09-11T13:20:07+00:00 heroku[web.1]: State changed from starting to up
2011-09-11T13:20:07+00:00 app[web.1]:
2011-09-11T13:20:07+00:00 app[web.1]:
2011-09-11T13:20:07+00:00 app[web.1]: Started GET "/" for 118.137.144.220 at 2011-09-11 06:20:07 -0700
2011-09-11T13:20:08+00:00 app[web.1]:
2011-09-11T13:20:08+00:00 app[web.1]: ActionController::RoutingError (uninitialized constant PagesController):
2011-09-11T13:20:08+00:00 app[web.1]:
2011-09-11T13:20:08+00:00 app[web.1]:
2011-09-11T13:20:08+00:00 app[web.1]:
2011-09-11T13:20:08+00:00 heroku[router]: GET vivid-sky-685.heroku.com/ dyno=web.1 queue=0 wait=0ms service=403ms status=404 bytes=728
2011-09-11T13:20:08+00:00 heroku[nginx]: 118.137.144.220 - - [11/Sep/2011:06:20:08 -0700] "GET / HTTP/1.1" 404 728 "-" "Mozilla/5.0 (X11; Linux i686; rv:2.0) Gecko/20100101 Firefox/4.0" vivid-sky-685.heroku.com
I know it's an old problem but I ran into it too. I realized I didn't change the root route in config/routes.rb before pushing. Not changing it might result in a welcome page locally, but on heroku it will get the above error.
I got the same problem; however, after changing 1 line code of production.rb located in config/environments/production.rb from
config.assets.compile = false
to
config.assets.compile = true
commit the new change. Then my sample app works fine on heroku
I'm using postgresql, and I also had page not showing up on heroku.
This command fixed it:
heroku run rake db:setup
and then
heroku rake db:migrate
I had migrated before, but hadn't done the setup first.
I also had tried setting
config.assets.compile = true
in production.rb, but that made no difference.
Have you tried running in production mode locally? Try rails server -e production and see if you get the same error, which you can then debug. Also make sure you've done heroku rake db:migrate.
In my case it was a missing starting page that did not cause a problem in development mode but did cause the above issue on heroku. The accepted answer on this thread sheds more light.
Ran into this problem as well. Solved it by setting a root route. In my case, root 'pages#home' in config/routes.rb
If the root route is not set, you are redirected to localhost:3000. Hence,
The page you were looking for doesn't exist. You may have mistyped the
address or the page may have moved.
1. Always set a root in routes. That's rails 101
I wouldn't go for making asset pre-compilation false all the time. For production app I feel it enhances the overall speed if assets have been pre-compiled.
2. As a rule of thumb I always run rake assets:precompile before pushing to git. Please try it. and then commit to git repository and then heroku. Do heroku restart
3. Another cause could be heroku rake db:migrate, please check if you did it
4. Also this is my Gemfile setup for the development and production groups
group :development do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
gem 'heroku-deflater'
end
I had a very similiar issue with heroku, found the answer from this question:
RefineryCMS routes for Home page doesn't work
To save you reading, the solution was to update "Home" using Advanced Options, there is a question:
"Forward this page to another website or page"
Fill this in with a / and it should work. This sounds a little backwards, as its actually setting /my_page to redirect to "/". But the way to think of it is:
Refinery pages extension is looking for a page with the url '/' to be
the home page. So by telling the page titled "Home" that you want it
to have the url '/' you're setting it as the definitive homepage as
far as Refinery pages extension is concerned.
(quote from #Philip Arndt)
So I had to run in this order and it worked for me
$ heroku rake db:migrate
$ heroku run rake db:setup
Specify Ruby version in app
Rails 5 requires Ruby 2.2.0 or above. Heroku has a recent version of Ruby installed by default, however you can specify an exact version by using the ruby DSL in your Gemfile.
At the end of Gemfile add:
ruby "2.4.1"
I had the same problem, but the thing is that the app is missing the home like root. The default home page for Heroku is this HTMLthe default page. But if you try all your defined routes they will work like:
appname.herokuapp.com/route
I got the same error but realized that I hadn't change the HTML verb from GET to ROOT in config/routes.rb file.
It was get "/hello", to: "application#hello"
I updated it to root "application#hello"
I then pushed it to git and deployed it to production.
I was facing the same error because I pushed same non-master branch to heroku master using this command git push heroku master . Which obviously cause conflicts.
I also checked the routes using heroku run rake routes. But the output was not my actual routes. Not even single one.
The proper way to push your non-master branch to heroku master is
git push -f heroku your_branch_name:master