Use request.env['SCRIPT_NAME'] instead of ENV['RAILS_RELATIVE_URL_ROOT']

RAILS_RELATIVE_URL_ROOT is deprecated and doesn't have to work with
newer Rails apps