我在Heroku上运行Rails 3应用程序。我在我的应用程序中使用Thinking Sphinx
搜索引擎。为了使它与Heroku一起工作,我已经按照Heroku文档的建议在我的gemfile中添加了一个flying-sphinx
gem。
这就是我在gemfile中的内容
gem 'thinking-sphinx', '2.0.11'
gem 'flying-sphinx', '0.7.0'
根据此处提到的步骤https://devcenter.heroku.com/articles/flying_sphinx, 添加了fly-sphinx插件(Heroku插件:添加flying_sphinx:木制), 我跑的时候 heroku运行fly-sphinx配置 我收到以下错误:
/app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.0/lib/flying_sphinx/sphinx_configuration.rb:2:in 'initialize': uninitialized constant FlyingSphinx::SphinxConfiguration::ThinkingSphinx (NameError)
from /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.0/lib/flying_sphinx/cli.rb:31:in 'new'
from /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.0/lib/flying_sphinx/cli.rb:31:in 'configure'
from /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.0/lib/flying_sphinx/cli.rb:20:in 'block in run'
from /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.0/lib/flying_sphinx/cli.rb:20:in 'each'
from /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.0/lib/flying_sphinx/cli.rb:20:in 'all?'
from /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.0/lib/flying_sphinx/cli.rb:20:in 'run'
from /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.0/bin/flying-sphinx:5:in ''
from vendor/bundle/ruby/1.9.1/bin/flying-sphinx:19:in 'load'
from vendor/bundle/ruby/1.9.1/bin/flying-sphinx:19:in ''
我无法继续前进。
答案 0 :(得分:1)
回答最初的问题 - 通过堆栈跟踪,如果看起来你正在使用fly-sphinx 0.8.0 - 这肯定是错误的,因此更新的版本。希望你遵循Bert的建议并给出0.8.5的旋转(0.7.1是Rails 2.3的最新版本)。
答案 1 :(得分:1)
我为rails 3设置了Gemfile设置:
gem 'thinking-sphinx', "~> 2.0.10", require: 'thinking_sphinx'
gem 'flying-sphinx', '0.8.4'
或
# sphinx
gem 'thinking-sphinx', '3.0.3'
gem 'flying-sphinx', '1.0.0'