-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot rake assets:precompile without database #78
Comments
Can you include the error? Thanks. |
Here's a gist |
@mceachen, any ideas on this? I think it's support.rb#L24. I guess I'll try to branch to see if this is it. |
Haven't been able to look at this much recently, but I have been able to narrow it down to a specific line within the acts_as_tree method here: acts_as_tree.rb#L24. So if I comment this line out, I can precompile assets successfully without requiring a database. I'll let you know as I figure anything out. Please let me know if this is making any sense to anyone else, or why closure_tree is even required when compiling assets. |
Also found this pull request for awesome_nested_set that seems related from a few years ago. |
And here's another pull request. I wish I had the time to help, but I just decided to use awesome_nested_set in the short term. |
Sorry for the delay, I'll try to get to this over the weekend. |
@axlekb , can you check this out? http://stackoverflow.com/a/18545752/172310 If not, I could add a rescue (but for what? a database connection error?) in ClosureTree::ActsAsTree#acts_as_tree so the includes would go ignored. |
I did not try that out. I wish I knew more about compiling assets and the such, but it was much easier for me to switch to awesome_nest_set instead. Not sure why that gem does not have the same issue. |
OK! Note that I wrote closure tree due to performance issues with nested set Thanks for taking the time to try to debug this! |
Yeah, I was excited about closure tree because of its dedication to performance. Unfortunately, having to manage commited compiled assets is worse to me than a bit of slow performance with hierarchies. |
OK, branch heroku_asset_compilation should work (it does for me, at least): Add this to your gem 'closure_tree', github: 'mceachen/closure_tree', branch: 'heroku_asset_compilation' and then If you're good, I'll push it out as v4.2.9. |
I pushed v4.2.9. YOU WILL LOVE IT |
Sorry, just getting back to this now. I tried switching back to closure_tree and am running into postgres errors. Don't have time to figure out what's causing this immediately, but if this error means anything to you, let me know.
|
No. I'd need more context to know what's wrong. That advisory lock is what I had to do to ensure consistency within the Did you call Thanks for taking another swing. |
Sorry, I initially failed to follow directions. But... I'm still having some issues on precompiling assets. The test that heroku suggested was to change database.yml to reference a database that doesn't exist. If I can I should also note that the model that throws the error is a subclass of a single table inheritance model that contains |
You randomly made my twitter feed today. Sorry about the fire. |
I'm trying to deploy my Rails app to Heroku, and that involves precompiling assets. Heroku's help pages say that the best way to figure out what is causing the problem is to change your database.yml file to point to a non-existant database.
So I've run
rake assets:precompile
without a database and it fails due to theacts_as_tree
inclusion in one of my models. When I comment outacts_as_tree
, the assets compile successfully.I did a quick look around, but couldn't find anything obvious. I'm obviously a little bit out of my comfort zone here, but I'd love to not have Heroku compile my assets when pushing rather than having to have my compiled assets as part of the repository.
Any help/insight/guidance appreciated.
The text was updated successfully, but these errors were encountered: