Installing Thinking Sphinx (Sinatra, Padrino and others)
Follow the instructions for Rails (going by the version of ActiveRecord you’re using), but then there’s two more things to do:
Firstly, you’ll need to add the Thinking Sphinx rake tasks to your Rakefile:
task:environmentdoSinatra::Application.environment='production'# or ENV['RACK_ENV'] if you're using rackendrequire'/path/to/your/app.rb'require'thinking_sphinx/tasks'
You will also need to make sure you require thinking_sphinx/sinatra instead of just thinking_sphinx - which is easily done in your Gemfile:
If you want to customise the environment and application root directory based on your own environment variables, you can do so with a few lines of Ruby code:
framework=ThinkingSphinx::Frameworks::Plain.newframework.environment=RACK_ENV# Defaults to productionframework.root='/srv/www/app'# Defaults to Dir.pwdThinkingSphinx::Configuration.instance.framework=framework