1

I need to parse sqlite files on heroku, and as far as i know Heroku does not support sqlite.

In local, i am using the gem sqlite3, but it is rejected when pushing on heroku. How can i use 'require sqlite3' in production ?

here is the error:

   An error occurred while installing sqlite3 (1.3.6), and Bundler cannot continue.
   Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.
   Failed to install gems via Bundler.
   Heroku push rejected, failed to compile Ruby/rails app

Thanks in advance

Ismael Abreu
  • 16,443
  • 6
  • 61
  • 75
mathieurip
  • 547
  • 1
  • 6
  • 16

1 Answers1

2

Pretty sure you just don't want to do that: https://devcenter.heroku.com/articles/how-do-i-use-sqlite3-for-development

Heroku doesn't support sqlite and you have to use PostgreSQL. Sorry dude.

This older SO thread has a work around though:

Deploying RoR app to Heroku with Sqlite3 fails

The winning answer there was just use sqlite for dev so: (copy pasting)

group :production, :staging do
  gem "pg"
end

group :development, :test do
  gem "sqlite3-ruby", "~> 1.3.0", :require => "sqlite3"
end
Community
  • 1
  • 1
Log_n
  • 404
  • 2
  • 5
  • Thanks for your answer, but unfortunately i knew what you said! I do not want to use sqlite as a database (i am using postresql) but i need to parse files (in sqlite format) uploaded by users on heroku. Do you any alternatives to parse sqlite files without using sqlite3 ? – mathieurip Sep 26 '12 at 22:29
  • 1
    Ah, sorry for misunderstanding your question. AFAIK you'd have to roll your own (heh or start with the one that sqlite uses: http://www.hwaci.com/sw/lemon/lemon.html) – Log_n Sep 26 '12 at 22:48
  • @mathieurip did you ever figure out how to do this? – Ryan Angilly Dec 08 '13 at 00:59
  • 1
    @RyanAngilly i switched to aws! – mathieurip Dec 20 '13 at 23:09
  • @mathieurip yup i'm moving to Digital Ocean. Oh well. Thanks! – Ryan Angilly Dec 21 '13 at 02:42