After a recent server switch I am having troubles getting a Ruby on Rails app with legacy (1.8) code up and running. I am testing it by running /www/application/public/dispatch.fcgi

**Enviroment**

* Freebsd 10.0
* Ruby 1.8.7 via RVM
* ruby19-gems-1.8.29
* Lighttpd-1.4.35\_2

**List of installed gems**

```
actionmailer (1.3.3)
actionpack (1.13.3)
actionwebservice (1.2.3)
activerecord (1.15.3)
activesupport (1.4.2)
bundler (1.6.3)
bundler-unload (1.0.2)
executable-hooks (1.3.2)
fcgi (0.9.2.1)
gem-wrappers (1.2.5)
rails (1.2.3)
rake (10.1.1)
rubygems-bundler (1.4.4)
rvm (1.11.3.9)

```

**fastcgi.crash.log**

```
[07/Jul/2014:17:01:45 :: 60555] starting
[07/Jul/2014:17:01:45 :: 60555] Dispatcher failed to catch: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.split (NoMethodError)
  /usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/cgi.rb:903:in `parse'
  /usr/local/rvm/gems/ruby-1.8.7-head/gems/actionpack-1.13.3/lib/action_controller/cgi_ext/raw_post_data_fix.rb:45:in `initialize_query'
  /usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/cgi.rb:2286:in `initialize'
  /usr/local/rvm/gems/ruby-1.8.7-head/gems/fcgi-0.9.2.1/lib/fcgi.rb:627:in `new'
  /usr/local/rvm/gems/ruby-1.8.7-head/gems/fcgi-0.9.2.1/lib/fcgi.rb:627:in `each_cgi'
  /usr/local/rvm/gems/ruby-1.8.7-head/gems/rails-1.2.3/lib/fcgi_handler.rb:141:in `process_each_request!'
  /usr/local/rvm/gems/ruby-1.8.7-head/gems/rails-1.2.3/lib/fcgi_handler.rb:55:in `process!'
  /usr/local/rvm/gems/ruby-1.8.7-head/gems/rails-1.2.3/lib/fcgi_handler.rb:25:in `process!'
  /www/checkout/public/dispatch.fcgi:24
almost killed by this error
[07/Jul/2014:17:01:45 :: 60555] Dispatcher failed to catch: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.split (NoMethodError)
  /usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/cgi.rb:903:in `parse'
  /usr/local/rvm/gems/ruby-1.8.7-head/gems/actionpack-1.13.3/lib/action_controller/cgi_ext/raw_post_data_fix.rb:45:in `initialize_query'
  /usr/local/rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/cgi.rb:2286:in `initialize'
  /usr/local/rvm/gems/ruby-1.8.7-head/gems/fcgi-0.9.2.1/lib/fcgi.rb:627:in `new'
  /usr/local/rvm/gems/ruby-1.8.7-head/gems/fcgi-0.9.2.1/lib/fcgi.rb:627:in `each_cgi'
  /usr/local/rvm/gems/ruby-1.8.7-head/gems/rails-1.2.3/lib/fcgi_handler.rb:141:in `process_each_request!'
  /usr/local/rvm/gems/ruby-1.8.7-head/gems/rails-1.2.3/lib/fcgi_handler.rb:55:in `process!'
  /usr/local/rvm/gems/ruby-1.8.7-head/gems/rails-1.2.3/lib/fcgi_handler.rb:25:in `process!'
  /www/checkout/public/dispatch.fcgi:24
killed by this error

```

**Contents of dispatch.fcgi**

```
#!/usr/local/bin/ruby18
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
# and the number of requests to process before running garbage collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
# and the GC period is nil (turned off).  A reasonable number of requests
# could range from 10-100 depending on the memory footprint of your app.
#
# Example:
#   # Default log path, normal GC behavior.
#   RailsFCGIHandler.process!
#
#   # Default log path, 50 requests between GC.
#   RailsFCGIHandler.process! nil, 50
#
#   # Custom log path, normal GC behavior.
#   RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
#
require File.dirname(__FILE__) + "/../config/environment"
require 'fcgi_handler'

RailsFCGIHandler.process!

```

Any ideas how this can be solved will be greatly appreciated. Please request more information in comments if need.