# ENV\['\_'\] present on MacOS X, missing on OpenBSD

**URL:** <https://www.ruby-forum.com/t/env-present-on-macos-x-missing-on-openbsd/146965>\
**Category:** Ruby\
**Created:** [August 27, 2008, 5:11am UTC](https://www.ruby-forum.com/t/env-present-on-macos-x-missing-on-openbsd/146965 "2008-08-27T05:11:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gideonking](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8e8cbc/32.png) [@gideonking](https://www.ruby-forum.com/u/gideonking)\
**Post date:** [August 27, 2008, 5:11am UTC](https://www.ruby-forum.com/t/env-present-on-macos-x-missing-on-openbsd/146965/1 "2008-08-27T05:11:07Z")

</div>

Hi,

The acts\_as\_ferret server refers to ENV[’\_’] in server\_manager.rb:

require(File.join(File.dirname(ENV[’\_’]), ‘…/config/environment’))

ENV[’\_’] is nil so the script fails. I am assuming that it is supposed  
to be the folder name of the script that is running or something like  
that, but I can’t find an documentation on it. I am also assuming that  
it may be one of those automatic environment variables passed in as part  
of the execution context on most systems, but may not be on FreeBSD.

Three things:

1. What should this be returning?

2. How can I get it to return the right thing?

3. If it is indeed returning the name of the folder where the script is  
executing from, couldn’t I jusr replace it with:

?

TIA

Gideon

---

<div class="post-metadata">

**Author:** ![gideonking](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8e8cbc/32.png) [@gideonking](https://www.ruby-forum.com/u/gideonking)\
**Post date:** [August 27, 2008, 5:19am UTC](https://www.ruby-forum.com/t/env-present-on-macos-x-missing-on-openbsd/146965/2 "2008-08-27T05:19:06Z")

</div>

Gideon King wrote:

> 1. If it is indeed returning the name of the folder where the script is  
> executing from, couldn’t I jusr replace it with:

of course that won’t work because we are not in the rails environment. I  
saw that there was another line in the ferret source that was commented  
out, and tried that instead, and it is working:

require(File.join(File.dirname( **FILE** ),  
‘…/…/…/…/config/environment’))

don’t know if there are any downsides to doing it that way, but at least  
I’m up and running.

Gideon
