norman/friendly_id — Issue #208: history module prevents asset precompilation on heroku's cedar stack
Author: sohara
Created: 2012-01-12 20:03:50+00:00
State: open

Hi there,
I've run into a rather strange issue/incompatibility between Friend ID's history module and asset precompilation on Heroku's cedar stack. I'm not sure what aspect of the module is causing this conflict, however Heroku's documentation has this to say:

"The most common cause of failures in assets:precompile is an app that relies on having its environment present to boot. Your app’s config vars are not present in the environment during slug compilation, so you should take steps to handle the nil case for config vars (and add-on resources) in your initializers."

"If you see something similar to the following:
could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port xxxx?
This means that your app is attempting to connect to the database as part of rake assets:precompile."

Indeed that's the error I'm getting on Heroku when :use is set to :history, but not when it is set to :slugged.

Also, I'm not getting that error on my mac in development.

Is there something in the module that requiring database access during slug compilation?
Thanks,
Sean