0

我在启动 rails 服务器时遇到错误。

Sphinx cannot be found on your system. You may need to configure the following
settings in your config/sphinx.yml file:
  * bin_path
  * searchd_binary_name
  * indexer_binary_name


For more information, read the documentation:
http://freelancing-god.github.com/ts/en/advanced_config.html

script/rails: No such file or directory - uname -p
C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.2/lib/action_dispatch/http/mi
me_type.rb:102: warning: already initialized constant MOBILE
Exiting
C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/client.
rb:44:in `connect': Unknown MySQL server host 'to appmallstaging.cxc6soormw9j.us
-east-1.rds.amazonaws.com' (0) (Mysql2::Error)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/m
ysql2/client.rb:44:in `initialize'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_r
ecord/connection_adapters/mysql2_adapter.rb:16:in `new'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_r
ecord/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_r
ecord/connection_adapters/abstract/connection_pool.rb:277:in `new_connection'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_r
ecord/connection_adapters/abstract/connection_pool.rb:287:in `checkout_new_conne
ction'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_r
ecord/connection_adapters/abstract/connection_pool.rb:235:in `block (2 levels) i
n checkout'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_r
ecord/connection_adapters/abstract/connection_pool.rb:230:in `loop'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_r
ecord/connection_adapters/abstract/connection_pool.rb:230:in `block in checkout'

        from C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_r
ecord/connection_adapters/abstract/connection_pool.rb:229:in `checkout'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_r
ecord/connection_adapters/abstract/connection_pool.rb:95:in `connection'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_r
ecord/connection_adapters/abstract/connection_pool.rb:374:in `retrieve_connectio
n'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_r
ecord/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_
connection'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_r
ecord/connection_adapters/abstract/connection_specification.rb:142:in `connectio
n'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_r
ecord/model_schema.rb:308:in `clear_cache!'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-3.2.2/lib/active_r
ecord/railtie.rb:91:in `block (2 levels) in <class:Railtie>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_
support/callbacks.rb:418:in `_run__777791075__prepare__723499589__callbacks'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_
support/callbacks.rb:405:in `__run_callback'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_
support/callbacks.rb:385:in `_run_prepare_callbacks'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_
support/callbacks.rb:81:in `run_callbacks'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.2/lib/action_dis
patch/middleware/reloader.rb:74:in `prepare!'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.2.2/lib/action_dis
patch/middleware/reloader.rb:48:in `prepare!'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/applic
ation/finisher.rb:47:in `block in <module:Finisher>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/initia
lizable.rb:30:in `instance_exec'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/initia
lizable.rb:30:in `run'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/initia
lizable.rb:55:in `block in run_initializers'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/initia
lizable.rb:54:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/initia
lizable.rb:54:in `run_initializers'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/applic
ation.rb:136:in `initialize!'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/railti
e/configurable.rb:30:in `method_missing'
        from D:/ROR/appmallserver/config/environment.rb:22:in `<top (required)>'

        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_
support/dependencies.rb:251:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_
support/dependencies.rb:251:in `block in require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_
support/dependencies.rb:236:in `load_dependency'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.2/lib/active_
support/dependencies.rb:251:in `require'
        from D:/ROR/appmallserver/config.ru:4:in `block in <main>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:
51:in `instance_eval'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:
51:in `initialize'
        from D:/ROR/appmallserver/config.ru:1:in `new'
        from D:/ROR/appmallserver/config.ru:1:in `<main>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:
40:in `eval'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:
40:in `parse_file'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:2
00:in `app'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/comman
ds/server.rb:46:in `app'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:3
01:in `wrapped_app'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:2
52:in `start'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/comman
ds/server.rb:70:in `start'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/comman
ds.rb:55:in `block in <top (required)>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/comman
ds.rb:50:in `tap'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/comman
ds.rb:50:in `<top (required)>'
        from script/rails:21:in `require'
        from script/rails:21:in `<main>'
4

3 回答 3

0

我开始这是作为评论,但它变得很长。

您必须正确设置它。Thinking Sphynx gem 依赖于 Sphynx 库,你还必须安装instuctions。这似乎是你现在的问题,但你必须做更多才能让它发挥作用。

你必须有 MySQL 和/或 PostgreSQL,你不能使用 SQLite。

按照 VenkatK 的链接学习如何操作。还有一个 railscasts 第 120 集-thinking -sphinx如果您是 railscasts 的专业会员,还有一个修订版第120-thinking-sphinx-revised

于 2012-12-14T08:49:14.437 回答
0

查看下面的链接并按照说明进行操作:

http://pat.github.com/ts/en/quickstart.html

希望对您有所帮助。

于 2012-12-13T11:27:40.373 回答
0

如错误消息所示,问题肯定出在您的配置上。重新安装 spinx 可能会对您有所帮助。

以下是类似的,

“在您的系统上找不到 Sphinx。” 运行“rake ts:index”时

于 2012-12-14T09:04:02.103 回答