Installing with Rails 2.3
Before we get carried away, it's worth noting that Flying Sphinx requires Rails 2.3.6 or better, and Thinking Sphinx 1.4.5 or better. If you're using older versions than that, I'm afraid you'll need to upgrade.
So we start by letting Heroku know (if you haven't already) that you'd like to use the Flying Sphinx add-on with your app:
heroku addons:add flying_sphinx:wooden
Wooden Sphinx is the entry-level plan, and unless you've got a large amount of data to index, you're probably going to be fine on this. However, feel free to peruse the other plans on Heroku's site.
Next up is getting the gem dependencies set in your Rails app.
If you're using Bundler, insert these lines into your
Gemfile
:
gem 'thinking-sphinx', '1.4.5'
gem 'flying-sphinx', '0.7.0'
Otherwise, put some very similar lines in your
config/environment.rb
file instead:
config.gem 'thinking-sphinx', :version => '1.4.5'
config.gem 'flying-sphinx', :version => '0.7.0'
And into your .gems
file as well:
thinking-sphinx --version 1.4.5
flying-sphinx --version 0.7.0
Finally, don't forget to add the rake tasks for both libraries
into your Rakefile
(Rails 2 doesn't do this
automatically):
require 'thinking_sphinx/tasks'
require 'flying_sphinx/tasks'
Deploy those changes, and you're good to go!