Any ideas why Thinking Sphinx Rake tasks are not running?

前端 未结 5 1006
离开以前
离开以前 2021-02-15 12:21

I\'m finding that Thinking Sphinx sometimes errors out when I try to run its Rake tasks. Sometimes the tasks work fine, and sometimes I get errors like the one below.

I\

5条回答
  •  无人共我
    2021-02-15 12:46

    I guess after deploy by capistrano you didn't run rake thinking_sphinx:configure
    it would generate sphinx config file in config/production.sphinx.conf

    try add pidfile to config/sphinx.yml

    production:
      ...
      pid_file: "/tmp/searchd.pid"
    

    it will make sure to find pid of searchd to kill

    and added following code to config/deploy.rb

    namespace :my_tasks do
      task :generate_sphinx_config, :roles => [:web] do
        run "cd #{latest_release} && RAILS_ENV=#{rails_env} bundle exec rake thinking_sphinx:configure"
      end
    end
    
    ....
    
    after :deploy, "my_tasks:generate_sphinx_config"
    

    to generate sphinx config file in each release folder

提交回复
热议问题