refinery / refinerycms-page-images

Adds an images tab to your pages so you can format a group of images really nicely on the frontend
104 stars 120 forks source link

heroku pre-compiling assets now fails #69

Closed andrewhavens closed 11 years ago

andrewhavens commented 12 years ago

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?

parndt commented 12 years ago

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.

robyurkowski commented 12 years ago

Sorry for terseness, but here's a quick fix: https://devcenter.heroku.com/articles/labs-user-env-compile

parndt commented 12 years ago

Yeah; I understand why you're doing it. :-)

Please see refinery/refinerycms#1751

andrewhavens commented 12 years ago

@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. =]

hayksaakian commented 11 years ago

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"
parndt commented 11 years ago

Did you enable user-env-compile?

hayksaakian commented 11 years ago

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.

parndt commented 11 years ago

Sure, could you please send a pull request? It's just the way it is with Heroku and this extension, unfortunately.

parndt commented 11 years ago

Fixed by #85

LoganDSPrice commented 7 years ago

@parndt How is this issue fixed now that Heroku has deprecated user-env-compile?

parndt commented 7 years ago

@LoganDSPrice have you encountered the issue?