figaro icon indicating copy to clipboard operation
figaro copied to clipboard

Spring Upgrade Broke Figaro for Rails Console

Open sidot3291 opened this issue 9 years ago • 6 comments

When I upgraded to Spring 1.3.3 in an existing app, Figaro broke for the console only.

Meaning, updates to application.yml would not be reflected in ENV. The contents from before the upgrade were somehow cached, even after running reload! or restarting the console.

I solved the problem by creating a config/initializers/spring.rb with:

if defined? Spring
    Spring.watch "config/application.yml"
end

The inconsistency between the web server (working) and the console (not working) made it difficult for me to diagnose. Maybe someone who has a deeper knowledge of Rails and Figaro can help determine the cause?

sidot3291 avatar Apr 12 '15 17:04 sidot3291

+1

alopes avatar May 01 '15 17:05 alopes

+1

cheneveld avatar May 04 '15 17:05 cheneveld

If an update to Spring is caused things to break, and this issue persists outside of restarts, I suspect you'll need to open an issue there.

Also, heads up: Steve's a bit of a spring hater.

fny avatar May 10 '15 14:05 fny

:+1: +1

siakaramalegos avatar Sep 15 '15 15:09 siakaramalegos

What an annoying bug :bomb:

dkobia avatar Jul 26 '16 14:07 dkobia

For anyone that is still bothered by this, the issue is that Spring does not watch aplication.yml by default. All you have to do is add this to a spring.rb initializer:

Spring.watch "config/application.yml"

Restart spring and you should be good to go.

tjaklitsch avatar Dec 20 '16 16:12 tjaklitsch