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

G

Gideon King

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:

require(RAILS_ROOT + '/config/environment')

?

TIA

Gideon
 
G

Gideon King

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

require(RAILS_ROOT + '/config/environment')

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,163
Latest member
Sasha15427
Top