R – How to include the capistrano thinking sphinx tasks when using the gem

rubyruby-on-railsthinking-sphinx

Im using the gem for thinking sphinx:

sudo gem install freelancing-god-thinking-sphinx \
  --source http://gems.github.com

So:

require 'vendor/plugins/thinking-sphinx/recipes/thinking_sphinx'

Which is prescribed on the website does not work.

How do I include the capistrano thinking sphinx tasks in my deploy.rb file when using the gem?

EDIT

Adding: require 'thinking_sphinx/deploy/capistrano'

gives me:

 
/usr/lib/ruby/gems/1.8/gems/freelancing-god-thinking-sphinx-1.1.12/lib/thinking_sphinx/deploy/capistrano.rb:1: undefined method `namespace' for main:Object (NoMethodError)
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
        from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from /usr/lib/ruby/gems/1.8/gems/capistrano-2.5.8/lib/capistrano/configuration/loading.rb:152:in `require'

Best Solution

The simple require as defined in another answer - thinking_sphinx/deploy/capistrano - should work. If it's not, are you seeing any errors? What version of the gem are you using?

If that fails, perhaps try a sudo gem update in case your gems are old.

Related Question