views:

57

answers:

1

After I deploy an app to Heroku, I run migration scripts and get this error message

...ites\padrino\prophetmargin> heroku rake ar:migrate
rake aborted!
SQLite3::ReadOnlyException: attempt to write a readonly database: CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
/disk1/home/slugs/215264_925fd2c_65a3/mnt/.bundle/gems/gems/padrino-core-0.9.11/lib/padrino-core/cli/rake.rb:9:in `init'

How can this be? I also tried running heroku dbpush sqlite://db/my-db.db and that also did not work.

A: 

heroku doesn't use sqlite3 but postgres. I'm not sure why you're getting this error though as I use sqlite3 in devel and when pushing to heroku they do some magic which migrates over to postgres.

I'm not exactly sure how Heroku does this db backend 'swap' but it looks like it's not happening for you as it's trying to write out the sqlite db file which obviously fails due to Heroku's read-only file system.

Sorry this isn't much of an answer, you may actually know all this already, but if you're new to heroku, it might give you some insight?

hmm... just noticed... what's the ar:migrate command? I haven't run Heroku for a few months which changes all the time, but normally you'd want a heroku rake db:migrate

brad