Conflict between PostgreSQL on Heroku and SQLite locally?

56 views
Skip to first unread message

Allan Lewis

unread,
Jul 1, 2011, 5:50:42 PM7/1/11
to hobo...@googlegroups.com
Hi,

I'm new to Hobo and Rails and I'm experimenting with Heroku. (Perhaps I'm getting ahead of myself, but anyway...)

The Heroku docs say that I need to change sqlite3 to pg in my Gemfile for deployment to Heroku to work, as they don't support SQLite. However, doing this seems to break Hobo completely as it then complains that SQLite is missing:
Hobo Command Line Interface 1.3.0.RC
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:239:in `require': no such file to load -- sqlite3 (LoadError)
How do I resolve this in such a way that I can use SQLite locally as a development database, but then deploy to Heroku and use its PostgreSQL database?

Sorry for such a newbie question!

Allan Lewis.

Mark Sobkowicz

unread,
Jul 1, 2011, 5:59:53 PM7/1/11
to hobo...@googlegroups.com
Try putting both sqlite3 and pg in the gemfile.  I don't think heroku will care that sqlite3 is there, as long as it can find pg.   There is also a way to specify different gems in the gemfile depending on environment - something like:

group :development, :test do
  gem
'sqlite3'
end

and so forth.

Allan Lewis

unread,
Jul 1, 2011, 6:27:54 PM7/1/11
to hobo...@googlegroups.com
I think the second part of your answer is what I was looking for. I can just declare "sqlite3" as you suggest, and then declare "pg" for production only.

Thanks.
Reply all
Reply to author
Forward
0 new messages