heroku pre-compiling assets now fails
andrewhavens opened this issue · 11 comments
So now that I've added the refinerycms-page-images gem and deploy to heroku, when it goes to pre-compile the assets to add to the slug, it fails with the message:
Running: rake assets:precompile
rake aborted!
could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
I am running Rails 3.2.6 and refinerycms/refinerycms-page-images '~> 2.0.0'
I found some articles online which say they solved the issue by adding this line to their config/application.rb file:
config.assets.initialize_on_precompile = false
But that resulted in a different error for me:
Running: rake assets:precompile
rake aborted!
undefined method `admin_dialogs_path' for #<Module:0x00000005d92da8>
(in /tmp/build_2lptj1tk77zwu/vendor/bundle/ruby/1.9.1/gems/refinerycms-core-2.0.5/app/assets/javascripts/refinery/boot_wym.js.erb)
Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)
Precompiling assets failed, enabling runtime asset compilation
Now I dont know what to do to fix this. What should I do?
I think that this gem does something naughty with the database upon initialize (like accessing a model,etc) that prevents the config.assets.initialize_on_precompile = true
case working.
Sorry for terseness, but here's a quick fix: https://devcenter.heroku.com/articles/labs-user-env-compile
Yeah; I understand why you're doing it. :-)
Please see refinery/refinerycms#1751
@robyurkowski that was a quick fix: https://devcenter.heroku.com/articles/labs-user-env-compile
@parndt I think you are answering a comment I quickly deleted because I realized that I misread your original comment. =]
was this ever resolved? I'm still seeing this issue on
gem "refinerycms-page-images", :git => "git://github.com/resolve/refinerycms-page-images.git", :branch => "2-0-stable"
Did you enable user-env-compile
?
I just did, and it worked.
However, it's not clear to me what the actual root of the problem is however.
The only config/vars I added for this gem was my s3 configuration (keys/bucket/etc) -- and I don't know why it'd be needed during asset pre-compilation.
If "that's just the way it is" I think this would be important to put in the readme to save everyone a few minutes of their life.
Sure, could you please send a pull request? It's just the way it is with Heroku and this extension, unfortunately.
@parndt How is this issue fixed now that Heroku has deprecated user-env-compile?
@LoganDSPrice have you encountered the issue?