# Env

**URL:** <https://www.ruby-forum.com/t/env/128427>\
**Category:** Ruby\
**Created:** [February 7, 2008, 4:56pm UTC](https://www.ruby-forum.com/t/env/128427 "2008-02-07T16:56:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![RVC\_planning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@RVC\_planning](https://www.ruby-forum.com/u/RVC_planning)\
**Post date:** [February 7, 2008, 4:56pm UTC](https://www.ruby-forum.com/t/env/128427/1 "2008-02-07T16:56:00Z")

</div>

Mac OS X example scripts have the command (directive/statement/?)…  
ENV[‘BRIDGE\_SUPPORT\_PATH’] = ‘/Volumes/Data/src/svn-rubycocoa-apple/  
framework/bridge-support’

I can’t find any write-up of this line anywhere. It’s in  
RSSPhotoViewer in Developer/Examples/Ruby/RubyCocoa/RSSPhotoViewer/  
rb\_main.rb

Can someone please explain what this is, what it does, and where it is  
documented?

---

<div class="post-metadata">

**Author:** ![RVC\_planning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@RVC\_planning](https://www.ruby-forum.com/u/RVC_planning)\
**Post date:** [February 7, 2008, 5:00pm UTC](https://www.ruby-forum.com/t/env/128427/2 "2008-02-07T17:00:46Z")

</div>

On Feb 7, 9:52 am, RVC planning [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Mac OS X example scripts have the command (directive/statement/?)…  
> ENV[‘BRIDGE\_SUPPORT\_PATH’] = ‘/Volumes/Data/src/svn-rubycocoa-apple/  
> framework/bridge-support’
> 
> I can’t find any write-up of this line anywhere. It’s in  
> RSSPhotoViewer in Developer/Examples/Ruby/RubyCocoa/RSSPhotoViewer/  
> rb\_main.rb
> 
> Can someone please explain what this is, what it does, and where it is  
> documented?

I’ve never worked on a Mac, but the ENV hash en ruby is a mechanism  
for accessing environment variables.

This:

# in ruby

ENV[‘PATH’] = ‘/usr/bin’

is equivalent to this:

/\* in csh \*/  
setenv PATH “/usr/bin”

---

<div class="post-metadata">

**Author:** ![RVC\_planning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@RVC\_planning](https://www.ruby-forum.com/u/RVC_planning)\
**Post date:** [February 7, 2008, 5:06pm UTC](https://www.ruby-forum.com/t/env/128427/3 "2008-02-07T17:06:07Z")

</div>

RVC planning wrote:

> ENV[‘BRIDGE\_SUPPORT\_PATH’] = ‘/Volumes/Data/src/svn-rubycocoa-apple/  
> framework/bridge-support’  
> […]  
> Can someone please explain what this is, what it does, and where it is  
> documented?

ENV is a Hash-like object (but not a hash) that contains the environment  
variables of your environment. ENV[‘BRIDGE\_SUPPORT\_PATH’] = ‘…’ sets  
the  
environment variable BRIDGE\_SUPPORT\_PATH to ‘…’ for you and all  
processes  
inheriting your environment.

HTH,  
Sebastian

---

<div class="post-metadata">

**Author:** ![RVC\_planning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@RVC\_planning](https://www.ruby-forum.com/u/RVC_planning)\
**Post date:** [February 7, 2008, 9:44pm UTC](https://www.ruby-forum.com/t/env/128427/4 "2008-02-07T21:44:46Z")

</div>

On Feb 7, 2008, at 10:05 AM, Sebastian H. wrote:

> variables of your environment. ENV[‘BRIDGE\_SUPPORT\_PATH’] = ‘…’  
> ICQ: 205544826

indeed,  
all this is doing is setting the path to the rubycocoa bridge,  
they’re setting that based on the location of the bridge as it is  
with the shipped version of Leopard (10.5)

---

<div class="post-metadata">

**Author:** ![RVC\_planning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@RVC\_planning](https://www.ruby-forum.com/u/RVC_planning)\
**Post date:** [February 7, 2008, 10:56pm UTC](https://www.ruby-forum.com/t/env/128427/5 "2008-02-07T22:56:43Z")

</div>

John J. wrote:

> On Feb 7, 2008, at 10:05 AM, Sebastian H. wrote:
> 
> > variables of your environment. ENV[‘BRIDGE\_SUPPORT\_PATH’] = ‘…’  
> > ICQ: 205544826
> 
> indeed,  
> all this is doing is setting the path to the rubycocoa bridge,  
> they’re setting that based on the location of the bridge as it is  
> with the shipped version of Leopard (10.5)

Actually, that was the developerâ€™s path. You can (and should) safely  
remove this line to use it on your machine, or set the path to a custom  
version of BridgeSupport if you have one.

---

<div class="post-metadata">

**Author:** ![RVC\_planning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@RVC\_planning](https://www.ruby-forum.com/u/RVC_planning)\
**Post date:** [February 8, 2008, 12:26am UTC](https://www.ruby-forum.com/t/env/128427/6 "2008-02-08T00:26:32Z")

</div>

On Feb 7, 2008 1:56 PM, Benjamin S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Actually, that was the developer’s path. You can (and should) safely  
> remove this line to use it on your machine, or set the path to a custom  
> version of BridgeSupport if you have one.

These lines were unfortunately left by error after a debugging  
session, I just removed them 🙂

Laurent

---

<div class="post-metadata">

**Author:** ![RVC\_planning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@RVC\_planning](https://www.ruby-forum.com/u/RVC_planning)\
**Post date:** [February 8, 2008, 3:19pm UTC](https://www.ruby-forum.com/t/env/128427/7 "2008-02-08T15:19:10Z")

</div>

On Feb 7, 2008, at 5:25 PM, Laurent S. wrote:

> > > with the shipped version of Leopard (10.5)

Thanks Laurent!  
It’s great to know that people at Apple are paying attention to  
things outside of Apple!
