What version of thinking-sphinx gem to use on Lion, Rails 2.3.9, sphinx 0.9.9 and Ruby 1.8.7?

326 views
Skip to first unread message

Stan Malone

unread,
Nov 7, 2011, 9:14:05 AM11/7/11
to thinkin...@googlegroups.com

The error I'm getting with the thinking-sphinx 2.1.0 gem is:

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

sh: searchd: command not found
Failed to start searchd daemon. Check /var/log/searchd.log.
Failed to start searchd daemon. Check /var/log/searchd.log
Be sure to run thinking_sphinx:index before thinking_sphinx:start

Search log is empty

and when I try to manually run rake task from bash I get:

rake aborted!
Unable to activate thinking-sphinx-2.0.10, because activerecord-2.3.9 conflicts with   activerecord (>= 3.0.3)

activerecord 3.0.3 downloaded with the thinking-sphinx gem 2.0.9 automatically.

I have tried almost every version of thinking sphinx, sphinx and riddle and just get various errors with every attempt.

Sphinx runs great from a bash command line, but no go from the rake tasks. I have tried the plugin, but that just throws a different set of errors. I am hoping someone knows of a combination of rails / riddle / thinking-sphinx and or sphinx versions on mac lion, if mac version even matters.

And my current conf is as follows:

development:
bin_path: /usr/local/Cellar/sphinx/0.9.9/bin
searchd_binary_name: searchd
indexer_binary_name: indexer
enable_star: true
enable_star: true
morphology: stem_en
html_strip: true
min_infix_len: 3
port: 9310
sql_range_step: 10000000
min_infix_len: 3

Thanks much in advance for any advice.

Cody Caughlan

unread,
Nov 7, 2011, 12:09:00 PM11/7/11
to thinkin...@googlegroups.com
Add /usr/local/Cellar/sphinx/0.9.9/bin

to your users $PATH or whomever the user is that is running the rake tasks

/Cody

On Nov 7, 2011, at 6:14 AM, Stan Malone wrote:

/usr/local/Cellar/sphinx/0.9.9/bin

Pat Allan

unread,
Nov 7, 2011, 12:12:19 PM11/7/11
to thinkin...@googlegroups.com
Hi Stan

The 2.x releases of Thinking Sphinx are for Rails 3.x - you should try the latest 1.4 release of TS instead (1.4.10). Not sure if that'll fix the warning message, but it's definitely going to be a good step forward.

Actually, just reading Cody's email - his suggestion should sort the warning out. An alternative is to add that bin path as the bin_path setting in config/sphinx.yml under the development environment settings (you'll need to create the file if you haven't already, and the structure is much like database.yml).

Let us know how you go.

Cheers

--
Pat

> --
> You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/thinking-sphinx/-/1ksTVaXR_EEJ.
> To post to this group, send email to thinkin...@googlegroups.com.
> To unsubscribe from this group, send email to thinking-sphi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.

Stan Malone

unread,
Nov 7, 2011, 4:08:12 PM11/7/11
to thinkin...@googlegroups.com
Thanks for the response. I added the recommendation to the conf file as well as the path. I also installed thinking-sphinx gem version 1.4.10. When I run rake thinking_sphinx:index from my rails root i get:

rake aborted!
Don't know how to build task 'thinking_sphinx:index'


and when I execute the rake task from netbeans IDE, I get:

Generating Configuration to /--my actual path from the root--/config/development.sphinx.conf
sh: indexer: command not found

Stan Malone

unread,
Nov 7, 2011, 4:12:59 PM11/7/11
to thinkin...@googlegroups.com
So, I made sure require 'thinking_sphinx/tasks' was included in my Rakefile in my rails root, and I get:

WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /opt/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
rake aborted!
no such file to load -- thinking_sphinx/tasks

when running rake thinking_sphinx:index from bash

and I get still get

Generating Configuration to /Users/iamtoc/execpastor.org/config/development.sphinx.conf

sh: indexer: command not found

when firing rake task from netbeans.




Stan Malone

unread,
Nov 7, 2011, 4:15:37 PM11/7/11
to thinkin...@googlegroups.com
How do I determine who the user is that is running the rake task?. Is there some example snippit that would illustrate how to implement this suggestion?  I'm fairly new to linux

Message has been deleted
Message has been deleted
Message has been deleted

Stan Malone

unread,
Nov 7, 2011, 4:52:14 PM11/7/11
to thinkin...@googlegroups.com
So just to be clear, I'm currently hanging on this error:

Stan:execpastor.org iamtoc$ rake thinking_sphinx:reindex

WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /opt/local/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
rake aborted!
no such file to load -- thinking_sphinx/tasks

(See full trace by running task with --trace)
Stan:execpastor.org iamtoc$




Stan Malone

unread,
Nov 7, 2011, 5:21:53 PM11/7/11
to thinkin...@googlegroups.com
If it helps: my development.sphinx.conf that is generated is:

indexer
{
}

searchd
{
  address = 127.0.0.1
  port = 9312
  log = /Users/iamtoc/execpastor.org/log/searchd.log
  query_log = /Users/iamtoc/execpastor.org/log/searchd.query.log
  pid_file = /Users/iamtoc/execpastor.org/log/searchd.development.pid
}

source form_entry_core_0
{
  type = mysql
  sql_host = 10.0.1.5
  sql_user = root
  sql_pass = ******
  sql_db = dbname
  sql_port = 0
  sql_query_pre = SET NAMES utf8
  sql_query_pre = SET TIME_ZONE = '+0:00'
  sql_query = SELECT SQL_NO_CACHE `form_entries`.`id` * CAST(1 AS SIGNED) + 0 AS `id` , `form_entries`.`storage_
string` AS `storage_string`, `form_entries`.`id` AS `sphinx_internal_id`, 0 AS `sphinx_deleted`, 2702525659 AS `class_crc` FROM `form_entries`    WHERE `form_entries`.`id` >= $start AND `form_entries`.`id` <= $end GROUP BY `form_entries`.`id`  ORDER BY NULL
  sql_query_range = SELECT IFNULL(MIN(`id`), 1), IFNULL(MAX(`id`), 1) FROM `form_entries`
  sql_range_step = 10000000
  sql_attr_uint = sphinx_internal_id
  sql_attr_uint = sphinx_deleted
  sql_attr_uint = class_crc
  sql_query_info = SELECT * FROM `form_entries` WHERE `id` = (($id - 0) / 1)
}

index form_entry_core
{
  source = form_entry_core_0
  path = /Users/iamtoc/execpastor.org/db/sphinx/development/form_entry_core
  charset_type = utf-8
}

index form_entry
{
  type = distributed
  local = form_entry_core
}




and my config/sphinx.conf is:


development:
bin_path: '/usr/local/Cellar/sphinx/0.9.9/bin'
searchd_binary_name: 'searchd'
indexer_binary_name: 'indexer'
pid_file:

enable_star: true
morphology: stem_en
html_strip: true
min_infix_len: 3
port: 9312
sql_range_step: 10000000
min_infix_len: 3

Pat Allan

unread,
Nov 8, 2011, 5:51:48 AM11/8/11
to thinkin...@googlegroups.com
Hi Stan

Not sure if you're firing the rake task always through netbeans or through the command line - it's best to use the command line. As for the user, it's whichever account you're currently using - so, very likely your own, given the paths in the generated configuration.

Also: you're sharing database passwords with us - might want to change that - and the file likely hasn't changed, given it can't even find the rake task. Can you share the contents of your Rakefile with us?

--
Pat

> --
> You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.

> To view this discussion on the web visit https://groups.google.com/d/msg/thinking-sphinx/-/A6FjGsnjy1YJ.

Stan Malone

unread,
Nov 15, 2011, 8:12:59 PM11/15/11
to thinkin...@googlegroups.com
Thanks for the reply pat. Finally got things to run on my workbox, now trying to replicate the same success on the production server. Here's what's happening.


I get this error (syntax error on line 9, col 0: `pid_file: /web_rails_path/log/searchd.development.pid') if I try any ts related rake commands or even try to launch the site. Passenger throws the same error. All works fine on my local iMac running Lion, but I'm getting this error on the production server which is running cent OS. Not sure if that makes a difference. I've verified that the index is stopping, indexing and starting correctly when running them from bash, just hanging somewhere within the rails / gem layers I think.

Other things that might help:
Ruby: 1.8.7
Thinking_sphinx: 1.4.10

The thing that's got me stumped is that when I look at the contents of the pid file, it's only got 1 number, one line. Where is it seeing line 9 when there is only 1 line in that file? I'm a very confused newbie :)

Stan Malone

unread,
Nov 15, 2011, 8:23:38 PM11/15/11
to thinkin...@googlegroups.com
Perhaps the syntax error in question is somewhere in my ruby code? 

Stan Malone

unread,
Nov 15, 2011, 8:36:04 PM11/15/11
to thinkin...@googlegroups.com
I removed some lines in my sphinx.yml and it fixed it. Still not sure why it didn't work on the production box and it does locally. But at least it's running.

Pat Allan

unread,
Nov 15, 2011, 8:51:28 PM11/15/11
to thinkin...@googlegroups.com
Can you run us through which lines you deleted from the sphinx.yml file?

--
Pat

On 16/11/2011, at 8:36 AM, Stan Malone wrote:

> I removed some lines in my sphinx.yml and it fixed it. Still not sure why it didn't work on the production box and it does locally. But at least it's running.
>

> --
> You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.

> To view this discussion on the web visit https://groups.google.com/d/msg/thinking-sphinx/-/eERe7JYkxksJ.

Reply all
Reply to author
Forward
0 new messages