0

My Ruby on Rails webapp allows for users to upload an sqlite database in order to export information from that database in a certain format. Locally everything works fine but I can't deploy it to heroku as I am using the sqlite gem. Heroku doesn't allow it even tho I use postgres for the app itself as configured in the database.yml.

Before I move everything to another PaaS I'd like to know are there any other ways to access the information in the sqlite DB without using the sqlite gem?

flexus
  • 465
  • 3
  • 9

1 Answers1

0

I'm afraid you can't use SQLite on Heroku (and I discourage you to use it in any production environment).

When deploying to Heroku the database.yml file gets replaced. Reading from the docs:

When an application is deployed, the build phase configures the underlying Rack or Rails application to use the provisioned database if a config directory exists, and a RAILS_ENV or RACK_ENV environment variable is present. Under these conditions, a database.yml file will be created . If a database.yml file already exists, it will be replaced. The database.yml file is created as Ruby code that dynamically creates its output by parsing the DATABASE_URL environment variable.

Source: https://devcenter.heroku.com/articles/ruby-support#build-behavior

If you want to use PostreSQL in Heroku, just put the needed gem in your Gemfile:

gem 'pg', group: :production
Mario Pérez Alarcón
  • 3,468
  • 2
  • 27
  • 38
  • The usecase of my app is that users upload an sqlite database and my app reads information from that database and exports it in a certain format. I don't think I can use postgres for that. Can postgres read sqlite db files? – flexus Nov 10 '14 at 02:15