Rails Working Directory?

#1
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

LiteSpeed Staff
#2
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?
 

mistwang

LiteSpeed Staff
#4
The fix actually turn out to be very simple. :)
Add
Code:
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.
 
Top