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
Related
The error message when I tried to start my app 'lvmine.herokuapp.com':
Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail
$ heroku logs --tail -a lvmine
We got
2022-02-06T05:34:41.193073+00:00 heroku[web.1]: State changed from crashed to starting
2022-02-06T05:34:43.080374+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 17601`
2022-02-06T05:34:45.446271+00:00 app[web.1]: => Booting WEBrick
2022-02-06T05:34:45.446285+00:00 app[web.1]: => Rails 3.2.19 application starting in production on http://0.0.0.0:17601
2022-02-06T05:34:45.446285+00:00 app[web.1]: => Call with -d to detach
2022-02-06T05:34:45.446285+00:00 app[web.1]: => Ctrl-C to shutdown server
2022-02-06T05:34:45.446286+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2022-02-06T05:34:46.018783+00:00 app[web.1]: Exiting
2022-02-06T05:34:46.019530+00:00 app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.19/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `initialize': SSL error: tlsv1 alert protocol version (PG::ConnectionBad)
2022-02-06T05:34:46.019531+00:00 app[web.1]: FATAL: no pg_hba.conf entry for host "44.200.80.186", user "sajwovtzpjymwu", database "d14n914sh0nmn", SSL off
Seems like SSL problem and Postgres error? I have no clues.
Can anyone help?
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've been working through Hartl's excellent RoR (3.2) tutorial (and deploying to Heroku throughout) and have become stumped why the Heroku version is no longer mirroring the behavior of the locally hosted app.
I'm at the end of section 7.4.4: http://ruby.railstutorial.org/chapters/sign-up?version=3.2#top
My locally hosted app passes all tests and is able to both create a new user and give appropriate error messages when user/email/password input is incorrect or out of spec. On the Heroku deployment of the app I am getting neither success in creating a user nor correct error pages as there seems to be something wrong with the password digest function in that version. I am taken to a generic Heroku "We're sorry, but something went wrong" page.
The "heroku logs" command gives me:
Started POST "/users" for 97.81.107.108 at 2012-04-10 19:41:17 +0000
2012-04-10T19:41:17+00:00 app[web.1]: Processing by UsersController#create as HTML
2012-04-10T19:41:17+00:00 app[web.1]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"0jnDCpFnVq9fd/v1lgLNB7g0wHuXGi5bocTD3SINRzc=", "user"=>{"name"=>"helloq", "email"=>"this#this.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Create my account"}
2012-04-10T19:41:17+00:00 app[web.1]:
2012-04-10T19:41:17+00:00 app[web.1]: app/controllers/users_controller.rb:12:increate'
2012-04-10T19:41:17+00:00 app[web.1]:
2012-04-10T19:41:17+00:00 app[web.1]: NoMethodError (undefined method password_digest=' for #<User:0x0000000229e9e0>):
2012-04-10T19:41:17+00:00 app[web.1]:
2012-04-10T19:41:17+00:00 heroku[router]: POST simple-sword-1851.herokuapp.com/users dyno=web.1 queue=0 wait=0ms service=128ms status=500 bytes=643
2012-04-10T19:41:17+00:00 app[web.1]: Completed 500 Internal Server Error in 104ms
2012-04-10T19:41:17+00:00 app[web.1]: app/controllers/users_controller.rb:12:innew'
Why would I get a NoMethodError when the password_digest method is functioning properly on the local deployment? I've checked with git that my local version and the remote heroku version are the same, and I've made sure to migrate the database and restart the app.
Thanks for any suggestions!
I am working through the tutorial as well and just about done. I want to follow up on Matthias's comment. Looking at chapter 7, he doesn't tell you how to reset the DB on Heroku yet. If you want to completely clear the DB and re-run the migrations do this:
heroku pg:reset SHARED_DATABASE --confirm simple-sword-1851
heroku run rake db:migrate
I had some problems occasionally when I messed up something in the migration.
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