I wound up solving this by establishing the DB connection unless Rails.env.production? && Rails.groups.include?('assets'). It seems to work alright.
On Sep 13, 12:22 pm, Chris Hanks <christopher.m.ha...@gmail.com> wrote: > I'm using Sequel with Rails 3.1.0, and connecting to my database by > simply passing a database url in a config var to Sequel.connect - the > standard way of doing it. It seems that when Heroku runs the asset > precompilation rake task during a deploy, my config vars apparently > aren't available to the app as it's initializing. Without a database > to connect to, it crashes. > > I could simply hack my way around this by rescuing from the connection > error, but I think that's a bad idea, since my app relies on the > database for all of its functionality - if the database is > unavailable, the app SHOULD be crashing when it's trying to establish > its connection. I think it makes more sense for my config vars to be > available to the app during asset compilation, but I'm not sure why > they're not already. > > Can someone from Heroku shed some light on this? Thanks! -- You received this message because you are subscribed to the Google Groups "Heroku" group. To post to this group, send email to heroku@googlegroups.com. To unsubscribe from this group, send email to heroku+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/heroku?hl=en.