freelancing-god/thinking-sphinx — Issue #313: undefined method `paths' for nil:NilClass
Author: christianhellsten
Created: 2011-12-02 09:56:56+00:00
State: open

This error:

undefined method `paths' for nil:NilClass

is caused by these lines in configuration.rb:

if defined?(Rails)
directories += Rails.application.paths['app/models'].to_a

The constant Rails might be defined even if Rails is not used, e.g. when using ActiveSupport with Sinatra.

Something like this should fix the issue:

if defined?(Rails) && Rails.respond_to?(:application)