我尝试通过执行heroku db:push
将数据库推送到heroku,这给了我以下错误:
! db:push and db:pull have been removed and replaced with pg:push and pg:pull.
! For more information, please see:
! devcenter.heroku.com/articles/heroku-postgresql#pg-push-and-pg-pull
所以我尝试heroku pg:push
给了我这个错误:
! `pg:push` is not a heroku command.
! Perhaps you meant `db:push` or `pg:ps`.
heroku help pg
给出了
pg:credentials DATABASE # Display the DATABASE credentials.
pg:info [DATABASE] # Display database information
pg:promote DATABASE # Sets DATABASE as your DATABASE_URL
pg:psql [DATABASE] # Open a psql shell to the database
pg:reset DATABASE # Delete all data in DATABASE
pg:unfollow REPLICA # stop a replica from following and make it a read/write database
pg:wait [DATABASE] # monitor database creation, exit when complete
我的应用程序位于雪松堆栈上,这是我正在使用的完整命令:
heroku pg:push my_local_name HEROKU_POSTGRESQL_CHARCOAL --app my_app_name
还尝试了添加pgbackups
的建议,但我仍然遇到同样的错误。
答案 0 :(得分:2)
我想通了,当我去看看1.9和2.0上的宝石之间是否存在差异时,我正在使用heroku gem(在ruby 1.9上)我看到了弃用通知。现在,这已按预期工作,安装了heroku-toolbelt并删除了宝石。
答案 1 :(得分:0)
在项目的目录中,安装点按宝石后,您可以尝试使用
taps server `heroku config:get DATABASE_URL` db db
启动点击服务器,然后
taps push mysql://[usernme]:[password]@[host]/[database] http://db:db@localhost:500
通过点击将本地数据库同步到heroku