Rails 4 - how to use sqlite3 in development and PostgreSQL in production w/Heroku

前端 未结 2 385
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-02 02:01

I am trying to deploy to Heroku but can\'t because the default sqlite3 server is still in place.

Detected sqlite3 gem which is not supported on Heroku.

相关标签:
2条回答
  • 2021-02-02 02:34

    Try using this for your production DB

    production:
      adapter: postgresql
      host: localhost
      encoding: unicode
      database: my_production_database
      pool: 5
      username:
      password:
    

    You can leave username and password blank

    0 讨论(0)
  • 2021-02-02 02:37

    Don't do it. You are just going to run into problems down the road. Use the same database in production and development. There are a lot of resources available in documenting the switch from a sqlite to postgres database.

    Take the time and switch.

    Have a look at this Rails Cast.

    http://railscasts.com/episodes/342-migrating-to-postgresql?view=asciicast

    0 讨论(0)
提交回复
热议问题