0

I've been playing around with Open Shift and tried to pass an environment variable. First, I set it with rhc env set TEST=foo -a myApp. Then I ensured it was there with rhc env list -a myAPP, and it was.

Nest, in my app, I put Test variable = <%= ENV['TEST'] %>, but nothing shows up after I deploy. Is there something I'm missing here? Running ruby 2.0 cartridge with Sinatra, fwiw.

2 Answers 2

3

Try doing a "stop" and "start" on your application (not a restart) and see if they show up, i believe the ruby cartridge just touches "tmp/restart.txt" in your rails application/passenger to restart it, which does not reload apache and pick up new environment variables (would probably do something similar with rack based applications that are not rails also)

rhc app <appname> stop
rhc app <appname> start
Sign up to request clarification or add additional context in comments.

2 Comments

That did it! Strange that a restart wouldn't do this too. Thanks for you help!
It's crazy. I spent the better part of the day trying to figure this out.
0

the document of rhc I've just check, it is now

rhc app-start <appname>
rhc app-stop <appname>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.