Reputation: 6466
Trying to deploy a very basic rails app to Heroku. It runs on sqlite3, and I've had some problems getting it to deploy.
First, I made sure the gem listed sqlite3 under development. That got the index page to finally work, but now when I deploy it and try to follow the links to the part of the page that actually relies on my database, heroku errors. I stared at the logs for a bit and have no idea what's going on, so I was hoping someone here might. I'll just post the log for what appears to be the last action (following the link) for now:
2012-09-13T01:00:23+00:00 heroku[router]: GET bloc-blog-1.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=187ms status=200 bytes=531
2012-09-13T01:00:24+00:00 heroku[router]: GET bloc-blog-1.herokuapp.com/assets/application-0149f820dbdd285aa65e241569d8c256.css dyno=web.1 queue=0 wait=0ms service=9ms status=200 bytes=811
2012-09-13T01:00:24+00:00 heroku[router]: GET bloc-blog-1.herokuapp.com/assets/application-1c74ddb87f4b5b3c36c58d068d148c95.js dyno=web.1 queue=0 wait=0ms service=9ms status=200 bytes=99469
2012-09-13T01:00:27+00:00 app[web.1]:
2012-09-13T01:00:27+00:00 app[web.1]:
2012-09-13T01:00:27+00:00 app[web.1]: Started GET "/posts" for 50.131.223.42 at 2012-09-13 01:00:27 +0000
2012-09-13T01:00:27+00:00 app[web.1]: Processing by PostsController#index as HTML
2012-09-13T01:00:27+00:00 app[web.1]: Completed 500 Internal Server Error in 75ms
2012-09-13T01:00:27+00:00 app[web.1]:
2012-09-13T01:00:27+00:00 app[web.1]: LINE 4: WHERE a.attrelid = '"posts"'::regclass
2012-09-13T01:00:27+00:00 app[web.1]: ^
2012-09-13T01:00:27+00:00 app[web.1]: : SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
2012-09-13T01:00:27+00:00 app[web.1]: FROM pg_attribute a LEFT JOIN pg_attrdef d
2012-09-13T01:00:27+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::Error: ERROR: relation "posts" does not exist
2012-09-13T01:00:27+00:00 app[web.1]: ON a.attrelid = d.adrelid AND a.attnum = d.adnum
2012-09-13T01:00:27+00:00 app[web.1]: WHERE a.attrelid = '"posts"'::regclass
2012-09-13T01:00:27+00:00 app[web.1]: ):
2012-09-13T01:00:27+00:00 app[web.1]:
2012-09-13T01:00:27+00:00 app[web.1]: app/controllers/posts_controller.rb:5:in `index'
2012-09-13T01:00:27+00:00 app[web.1]: AND a.attnum > 0 AND NOT a.attisdropped
2012-09-13T01:00:27+00:00 app[web.1]:
2012-09-13T01:00:27+00:00 app[web.1]: ORDER BY a.attnum
2012-09-13T01:00:27+00:00 heroku[router]: GET bloc-blog-1.herokuapp.com/posts dyno=web.1 queue=0 wait=0ms service=86ms status=500 bytes=643
Thanks!
Upvotes: 0
Views: 139
Reputation: 46960
Heroku uses PostgreSQL. Follow the instructions in the Rails Tutorial Book to install PostgreSQL locally so that you can duplicate the Heroku DB environment. Heroku itself and also just about every tutorial warn that developing in sqlite3 then deploying to PostgreSQL is fraught with peril.
Upvotes: 1