LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Ruby/Rails > Rails Working Directory?

Reply
 
Thread Tools Display Modes
  #1  
Old 12-11-2006, 12:59 PM
Hiro Protagonist Hiro Protagonist is offline
New Member
 
Join Date: Dec 2006
Posts: 2
Default Rails Working Directory?

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
Reply With Quote
  #2  
Old 12-11-2006, 03:24 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,585
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?
Reply With Quote
  #3  
Old 12-11-2006, 03:41 PM
Hiro Protagonist Hiro Protagonist is offline
New Member
 
Join Date: Dec 2006
Posts: 2
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
Reply With Quote
  #4  
Old 12-11-2006, 04:06 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,585
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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:38 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.