Hi I wanted to deploy the app (first time ) and created a database on the server. Then I ran bundle exec cap production deploy. I am still in my own repository, but except the addition to the Gemfile “gem ‘pg’” its basically like the HEAD of master (deploy:check works).
I get the following error when db:migrate is run:
Exception while executing as simon@xxxxxxx: Exception while executing as simon@xxxxxxx: rake exit status: 1
rake stdout: == 1 CreateUsers: migrating ===================================================
– create_table(:users)
→ 0.0039s
– add_index(:users, :nick, {:unique=>true})
→ 0.0022s
– add_index(:users, :email, {:unique=>true})
→ 0.0018s
Creating user admin with password ‘secret’…
rake stderr: rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::UndefinedTable: ERROR: relation “settings” does not exist
LINE 5: WHERE a.attrelid = ‘“settings”’::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = ‘“settings”’::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
What is the correct workflow when deploying the first time?
- I tried deploy cap production deploy (failed)
- Then created db on server
- Run deploy production again (failed again, s. above)
- Then on server: ENV bundle exec rake db:create (but wont work as db already exist)
Sorry for the newie question, but I after having spent quite some time I hope someone can make me understand…