How can I include capsule-related tasks when using gemstones

Im using a gem for sphinx thinking:

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

So:

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

What it means prescribed on the website does not work.

How to include cappano analysis of sphinx tasks in deploy.rb file when using gem?

EDIT

Addendum: 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 '

+4
source share
4 answers

A simple requirement defined in another answer - thinking_sphinx / deploy / capistrano - should work. If this is not the case, do you see errors? What version of the gem are you using?

If this fails, try sudo gem update if your gems are out of date.

+5
source

@Khelll: could you read the topic? You embed code to use TS as a plugin.

As a gem you should use:

 require 'thinking_sphinx/deploy/capistrano' 

This works great.

You should also modify the capistrano tasks mentioned on the website to reflect new ones before and after callbacks from capistrano to get rid of rejection notifications:

 before "deploy:update_code", "thinking_sphinx:stop" after "deploy:symlink", "symlink_sphinx_indexes" after "deploy:symlink", "thinking_sphinx:configure" after "deploy:symlink", "thinking_sphinx:start" 
+3
source

You talk about installing the gem, and then require a plugin. Have you tried installing the version of the Thinking Sphinx plugin?

EDIT: I speak too fast, clearly. Deployment recipes are in lib/thinking_sphinx/deploy/capistrano . Try require 'thinking_sphinx/deploy/capistrano' and you should have access to deployment recipes - in a test project, I just dropped this into my Rakefile and I have access to them.

In the new project, I put the following into my Capfile:

 load 'deploy' if respond_to?(:namespace) # cap2 differentiator Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } load 'config/deploy' require 'thinking_sphinx/deploy/capistrano' 

When I do cap -T, I see capitionano think_sphinx tasks. I think I wrote above because I have the plugin installed. / I smell like myself.

+1
source

What about:

 require 'vendor/plugins/thinking_sphinx/lib/thinking_sphinx/deploy/capistrano' 
0
source

All Articles