How can I pull an existing heroku app to new location for development?

前端 未结 5 1856
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-02 05:24

I currently have the latest version of my code on another computer that I want to develop from (Home computer and laptop for when I\'m out and about) I set up heroku for my

5条回答
  •  执念已碎
    2020-12-02 06:04

    If you first need to get the app from Heroku, clone your app.

    To do that, write in your Terminal:

    heroku git:clone -a your_app_name
    

    If you already have the app and the remote to heroku follow the next steps. If not, you can check instructions here https://devcenter.heroku.com/articles/git

    1. Find the name of your database

    Write in your Terminal:

    heroku pg:info -a your_app_name
    

    it will look something like this:

    HEROKU_POSTGRESQL_MAROON_URL
    
    1. Find the name of your local database

    In your Rails app go to config/database.yml

    it will look something like this:

    your_app_name_development
    
    1. Clone your production database (PostgreSQL)

    Write in your Terminal with your own database names:

    heroku pg:pull HEROKU_POSTGRESQL_MAROON_URL your_app_name_development -a your_app_name
    

    HEROKU_POSTGRESQL_MAROON_URL is an example of how could be the name of your production database (in Heroku): my_app_name_development is the name of your development database (locally) the_name_of_my_app is the name of your app in Heroku

    Don't forget to finish this with bundle install...

提交回复
热议问题