flying sphinx noMethodError =>未定义的方法'生成'

时间:2013-04-02 10:39:57

标签: ruby-on-rails ruby-on-rails-3 sphinx thinking-sphinx

我正在将我的网站推向heroku,并且遇到了飞行狮身人面像的问题。

我在开发中实现了一个有效的Thinking-Sphinx搜索功能。它工作得很好。我获得了飞行狮身人面像。但是当我跑步时:

heroku run flying-sphinx configure

我收到以下错误消息:

Connecting to database specified by DATABASE_URL
/app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.5/lib/flying_sphinx/sphinx_configuration.rb:24:in `content': undefined method `generate' for #<ThinkingSphinx::Configuration:0x00000004648e90> (NoMethodError)
    from /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.5/lib/flying_sphinx/sphinx_configuration.rb:8:in `upload_to'
    from /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.5/lib/flying_sphinx/cli.rb:32:in `configure'
    from /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.5/lib/flying_sphinx/cli.rb:20:in `block in run'
    from /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.5/lib/flying_sphinx/cli.rb:20:in `each'
    from /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.5/lib/flying_sphinx/cli.rb:20:in `all?'
    from /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.5/lib/flying_sphinx/cli.rb:20:in `run'
    from /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.5/bin/flying-sphinx:5:in `<top (required)>'
    from /app/bin/flying-sphinx:19:in `load'
    from /app/bin/flying-sphinx:19:in `<main>

以下是我使用的版本:

Rails 3.2.11
Thinking-Sphinx 3.0.2
Flying-Sphinx 0.8.5
MySQL2 0.3.12

(我的数据库在PostGresql上运行 - MySQL2仅用于Sphinx)

1 个答案:

答案 0 :(得分:2)

我在Laurent的其他地方已经解决了这个问题,但其核心是:fly-sphinx的gem版本(最高0.8.5)不支持Thinking Sphinx v3。我确实已经准备好了,只需等待其他依赖项来合并一些提交并发布自己的gem更新。

与此同时,您可以通过git使用最新版本(也可以使用最新版本的Thinking Sphinx v1 / v2 / v3):

gem 'pusher-client',
  :git    => 'git://github.com/pat/pusher-ruby-client.git',
  :branch => 'catch-io',
  :ref    => '608cc28d1a'
gem 'flying-sphinx',
  :git    => 'git://github.com/flying-sphinx/flying-sphinx.git',
  :branch => 'master',
  :ref    => 'e1395e724a'

如果您使用的是Ruby 1.8.7,那么您还需要以下gem来涵盖标准库中OpenSSL的一些限制:

gem 'openssl-nonblock', '0.2.1'