Nuno Roma
Nuno Roma

Reputation: 119

Ruby app pushed to Heroku displaying issues

I am running a Ruby on Rails application with a PostgreSQL database. This is the first time I pushed an app with its database to heroku, so I had no idea what to expect. What I got was my main page working as intended; but the Users page (page created by Rails scaffold command wich should display database query functions ex. "Create User") is not showing. Instead, a "We're sorry, but something went wrong. We've been notified about this issue and we'll take a look at it shortly." This hasn't change since yesterday.

Also, my app main heroku page is displaying some "Dyno" bars. These seem like progress bars, only they add payment required if I try to pull them foward. On top of each bar, a command is listed:

I have modified my database.yml file so it matches the Postgres database in Heroku specifications, so it goes something like this now:

>     production:
>       adapter: postgresql
>       encoding: unicode
>       database: d6i4fnhdh54239
>       pool: 5
>       username: evlptakrsjivpi
>       password: N6upI3-WSvca90zMXp8iKOXxh2
>       host: ec2-23-21-243-117.compute-1.amazonaws.com
>       port: 5432

But this file is in the .gitignore by default, so commiting the changes doens't even count as a commit. I'm really lost here. This is my heroku log error:

> 2013-12-11T21:17:28.683243+00:00 app[web.1]:
> ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR:  relation
> "users" does not exist 2013-12-11T21:17:28.683243+00:00 app[web.1]:
> LINE 1: SELECT     "users".* FROM       "users"
> 2013-12-11T21:17:28.683243+00:00 app[web.1]:                          
> ^ 2013-12-11T21:17:28.683243+00:00 app[web.1]: : SELECT     "users".*
> FROM       "users"): 2013-12-11T21:17:28.683243+00:00 app[web.1]:  
> app/controllers/users_controller.rb:5:in `index'
> 2013-12-11T21:17:28.683243+00:00 app[web.1]:
> 2013-12-11T21:17:28.683243+00:00 app[web.1]:
> 
>  !    Command cancelled.

Upvotes: 1

Views: 141

Answers (1)

Donovan
Donovan

Reputation: 15917

Heroku will recreate your database.yml to match their internal database schemes, so you don't need to do that manually. However, you do need to treat it like a distinct database, which means separate database migrations.

So, make sure you run heroku run rake db:migrate to update your tables.

Upvotes: 3

Related Questions