Jerome
Jerome

Reputation: 6189

adapter is postgresql, rails server Can't connect to MySQL server

Although database.yml is configured as follows,

development:
  adapter: postgresql
  database: saim_development
  username: jerdvo

launching Thin web server (v1.5.0 codename Knife), apparently runs OK. But any thinking-sphinx search generates

Can't connect to MySQL server on '127.0.0.1'

Gemfile contains

gem 'rails', '3.2.13'
gem 'will_paginate', '3.0.4'
gem 'devise', '2.2.3'
gem 'devise-i18n'
gem 'pg', '0.15.1'
gem 'pundit', '0.2.0'
gem 'mysql2', '0.3.12b5'
gem 'thinking-sphinx', '3.0.3'
gem 'rake', '10.0.4'
gem 'dynamic_form', '1.1.4'
gem 'jquery-rails', '2.2.1'
gem 'json', '1.7.7'
gem 'capistrano', '2.14.2'
gem 'passenger', '3.0.19'
gem 'paperclip', '3.4.0'
gem 'rvm-capistrano', '1.2.7'
#gem 'sqlite3'
gem 'globalize3', '0.3.0'
gem 'batch_translations', '~> 0.1.2'
gem 'ya2yaml', '~> 0.31'

group :development do
  gem 'mongrel', '1.2.0.pre2'
  gem 'thin', '1.5.0'
  gem 'ruby-debug19'
  gem 'capistrano', '2.14.2'
  gem 'translate-rails3', '~> 0.2.3', :require => 'translate'
end

Other useful information.

/usr/local/bin/psql

is aliased properly to

/usr/local/Cellar/postgresql/9.2.4/bin/psql

This is however the second version of postgresql installed via homebrew, aside from the Apple pre-install. I may have had a server session running when upgrading postgre.

Searches not running via sphinx are generating results. My interpretation is thinking-sphinx erroneously believes it should hook up to mysql.

Upvotes: 1

Views: 576

Answers (1)

pat
pat

Reputation: 16226

Thinking Sphinx connects to Sphinx using the mysql41 protocol - essentially, it behaves like a MySQL server, which is why the mysql2 gem is required. So what this error is actually saying is that Sphinx is not running: have you run the Thinking Sphinx rake tasks to index your data and start the daemon?

rake ts:index
rake ts:start

Upvotes: 2

Related Questions