Problem setting environment variables



I’m trying to set some environment variables that will be available to my Rails app, using the ENV-button in the runner. When i check for the presence of these variables in the Rails console, running ENV[“VARIABLE_NAME”], it outputs nil. I have tried to restart the app and the console, with no luck.

Any idea of what I’m doing wrong?

browserSync elixir in laravel skips opened assigned port

runner sets only variables in its own terminal. If you want to change a variable everywhere
run c9 ~/.bashrc and add export VARIABLE_NAME=VARIABLE_VALUE to the end


Thanks for your reply, harutyun! Can you please explain something for me? What do you mean by “it’s own terminal” when this runner/terminal runs the rails server for my app, shouldn’t the variables be available to that same app?

And if I set the variables using c9 ~/.bashrc, and they become available everywhere, does this mean everywhere in the workspace or all my C9 workspaces?

My issue originates in this unanswered question on stackoverflow, where I can’t seem to do the “simple” task of setting environment variables for Gmail credentials in a Rails mailer:


I set a variable using .bashrc as the answer suggested. When I run my rails console, I can access that variable via ENV. However it’s apparently not accessing it when loading the development.rb environment file.

Setting a group of configurations in ENV is a ubiquitous part of running Rails apps. I suggest adding support for this to c9. The ENV menu in the Rails server’s terminal should set the ENV variable in all the terminals. Thanks!


That worked thank you sooo much. I spent hours trying to get my env variables to work on c9.