# Capistrano - want to environment variable to be set

**URL:** <https://www.ruby-forum.com/t/capistrano-want-to-environment-variable-to-be-set/133174>\
**Category:** Rails\
**Created:** [March 28, 2008, 3:19pm UTC](https://www.ruby-forum.com/t/capistrano-want-to-environment-variable-to-be-set/133174 "2008-03-28T15:19:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![miken700](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@miken700](https://www.ruby-forum.com/u/miken700)\
**Post date:** [March 28, 2008, 3:19pm UTC](https://www.ruby-forum.com/t/capistrano-want-to-environment-variable-to-be-set/133174/1 "2008-03-28T15:19:09Z")

</div>

I’m running centos on my server, and naturally, I’m using capistrano to  
deploy rails.

I have a script, /etc/profile, that runs when I log in via ssh. It sets  
a bunch of environment variables like PATH, and GEM\_HOME.

However, when I run a command from capistrano, like

> run “rake db:migrate”  
> it can’t find rake, because /etc/profile is never run (and never sets  
> PATH), even though I’m using the same user as when I ssh in manually.

Any ideas how I can make sure /etc/profile is run before every  
capistrano shell session?

Thanks,  
Mike
