Google Groups Home
Help | Sign in
Message from discussion Setting Environment variables via run on RHEL
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
chris.a.williams@gmail.co m  
View profile
 More options Oct 27 2006, 11:03 am
From: "chris.a.willi...@gmail.com" <chris.a.willi...@gmail.com>
Date: Fri, 27 Oct 2006 15:03:19 -0000
Local: Fri, Oct 27 2006 11:03 am
Subject: Setting Environment variables via run on RHEL
I'm running a Rails app which uses the Oracle database adapter. One of
the things required by the underlying Oracle client is to have the
ORACLE_HOME environment variable set properly (or the driver chokes
whenever Rails is loaded).

I'm using bash, and my bashrc file isn't getting loaded. But I also
can't seem to set the environment variables via run commands in a task
that gets fired off before any other actions.

I have the following task:

task :env_dump, :roles => :app do
  run "ORACLE_HOME=/opt/oracle/instantclient_10_2"
  run "echo $ORACLE_HOME"
  run "echo $PATH"
end

The path gets echoed out, but nothing gets spit out after the echo
$ORACLE_HOME line. I've also tried executing a script which sets the
environment, but that doesn't seem to work either. Until I can properly
set the environment variables, deployment needs to be done manually by
logging in (where the environment does get set up as soon as I login
via my .bashrc file).

Has anyone else seen this? Has anyone been able to get around it?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google