Running into problems with creating a file on Heroku (Rails)

前端 未结 2 445
长发绾君心
长发绾君心 2020-12-22 09:42

So I have a user model and upon a user\'s registration I need to generate a file with some specific user information in it. Heroku is not allowing me to do that. Is there an

2条回答
  •  一向
    一向 (楼主)
    2020-12-22 09:53

    Heroku's file system is read-only. The only exception is the tmp dir, but that's, well, temporary. S3 is a common solution. Another possibility is saving that "file" to the database (use a "text" column in your migration). You could also use some document store, such as CouchDB or MongoDB and store your "file" there. There are several Heroku add-ons for Couch and Mongo that even offer a free tier.

提交回复
热议问题