PDA

View Full Version : Rails Working Directory?


Hiro Protagonist
12-11-2006, 12:59 PM
It seems like the rails working directory is not properly set to the VH_ROOT, which is affecting some of the relative paths I use in my Rails app.

The working directory seems to be set to where the ruby executable resides, /usr/local/bin in my case. Am I doing something wrong, or is this a bug?

Thanks,
Martin

mistwang
12-11-2006, 03:24 PM
Yes, it is a bug in current ruby-lsapi. Will be address in next release.

Which directory should be set as CWD in Rails? $RAILS_ROOT/public or something else?

Hiro Protagonist
12-11-2006, 03:41 PM
It should be $RAILS_ROOT. This issue is somewhat critical for me, any estimate for the bugfix release or ideas for a temporary workaround?

Martin

mistwang
12-11-2006, 04:06 PM
The fix actually turn out to be very simple. :)
Add
Dir.chdir( ENV['RAILS_ROOT'] )

at the beginning of RailsRunner.rb, before the first "require ..."

Please let me know it fixes your problem or not.