Search code examples
ruby-on-railsthinking-sphinxwhenever

thinking sphinx index rebuild with ruby error


Running a cron job via Whenever gem where rake "ts:index" is set to run at a certain frequency, the sphinx_index.log is returning an odd error (the only info in the log):

Your Ruby version is 1.9.3, but your Gemfile specified 2.2.3

if bundle exec rake ts:rebuild is run on the server manually, the process executes properly. (I have yet to test whether the indexing does actually occur and picks up changes). The Ubuntu server does have 2.2.3 installed, though it may have had 1.9.3 natively installed.

Why is this occurring and what is its consequence?


Solution

  • Pat's answer is the correct thread of investigation.

    Ben Scheirman's solution works as described for applications using the whenever gem. To use the proper ruby versions, rbenv's shims folder needs to be declared to the PATH.