Rails Working Directory?

Discussion in 'Ruby/Rails' started by Hiro Protagonist, Dec 11, 2006.

  1. Hiro Protagonist

    Hiro Protagonist New Member

    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
  2. mistwang

    mistwang LiteSpeed Staff

    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?
  3. Hiro Protagonist

    Hiro Protagonist New Member

    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
  4. mistwang

    mistwang LiteSpeed Staff

    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.

Share This Page