LoadError with Rails

Discussion in 'Ruby/Rails' started by parra, Jun 13, 2007.

  1. parra

    parra New Member


    I'm using LiteSpeed with Ruby on Rails, configured with LSAPI.
    My Rails version is 1.2.3
    I've this strange error:

    A LoadError occurred in distro#index:

    Expected config/../app/controllers/tj/tarefa.rb to define Tj::Tarefa
    /usr/lib64/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:250:in `load_missing_constant'

    The file is there and the error is intermitent.

    After lots of tests, I found that it happens after some time of inativity...

    The number of seconds of inativity is dependent of the value in LSAPI_MAX_IDLE.

    If I set it to 100, and stay 110 seconds without accessing my application, it raises the error.... if I stay less than 100, it works perfectly....

    Can someone figure why is this happening ???

    Thanks in advance....

  2. mistwang

    mistwang LiteSpeed Staff

    Does the error happen when the next request comes in and causes the request to fail, or it happens when the children ruby process exit after "LSAPI_MAX_IDLE", just got a exception logged into the log file?

    How about preload the those classes in your environment.rb?
  3. parra

    parra New Member

    Reply to Thread

    Hello mistwang,

    The error happen when the next request comes in and causes the request to fail.
    I preloaded the class in enviroment.rb, and now it's working fine.

    Just don't know why it hapens with LiteSpeed.... with Mongrel was working fine....

  4. mistwang

    mistwang LiteSpeed Staff

    ruby-lsapi fork children processes to handle requests. For some reasons, children ruby process has issues when it fork again, like calling popen(), etc. And I believe ruby has fork related bugs in its core library.

Share This Page