tag:support.flying-sphinx.com,2011-01-05:/discussions/problems/136-thinkingsphinx-tsrebuild-works-in-dev-and-test-but-error-in-production-modeFlying Sphinx: Discussion 2012-02-04T03:13:14Ztag:support.flying-sphinx.com,2011-01-05:Comment/132746792012-01-30T03:49:59Z2012-01-30T03:51:22ZThinkingSphinx ts:rebuild works in dev and test, but error in production mode. <div><p>If I set Rails 3 development db connect to my local production
db, ts:rebuild works fine. So it is not a problem with the
database.</p>
<p>-- Gemfile</p>
<p>gem 'thinking-sphinx', '2.0.10', :require =>
'thinking_sphinx'<br>
gem 'flying-sphinx', '0.6.1'</p>
<p>----- sphinx.yml</p>
<p>development:<br>
morphology: stem_en enable_star: true min_prefix_len: 3
max_matches: 10000 port: 9312</p>
<p>test:<br>
morphology: stem_en enable_star: true min_prefix_len: 3
max_matches: 10000 port: 9313</p>
<p>production:<br>
morphology: stem_en enable_star: true min_prefix_len: 3
max_matches: 10000 port: 9314</p>
<p>-------------- below is the error output when ts:rebuild
RAILS_ENV = production</p>
<p><strong>Invoke ts:config (first_time)</strong> Invoke
thinking_sphinx:configure (first_time) <strong>Invoke
thinking_sphinx:app_env (first_time)</strong> Execute
thinking_sphinx:app_env ** Execute thinking_sphinx:configure
Generating Configuration to
/home/ubuntu/projs/demoslm/config/production.sphinx.conf<br>
rake aborted!<br>
Riddle::Configuration::ConfigurationError<br>
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/riddle-1.5.1/lib/riddle/configuration/searchd.rb:24:in
<code>render'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/riddle-1.5.1/lib/riddle/configuration.rb:29:in</code>render'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/thinking-sphinx-2.0.10/lib/thinking_sphinx/configuration.rb:175:in
<code>block in build'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/thinking-sphinx-2.0.10/lib/thinking_sphinx/configuration.rb:174:in</code>open'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/thinking-sphinx-2.0.10/lib/thinking_sphinx/configuration.rb:174:in
<code>build'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/thinking-sphinx-2.0.10/lib/thinking_sphinx/tasks.rb:80:in</code>block
(2 levels) in '
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
<code>call'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/task.rb:205:in</code>block
in execute'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
<code>each'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/task.rb:200:in</code>execute'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/task.rb:158:in
<code>block in invoke_with_call_chain'
/home/ubuntu/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in</code>mon_synchronize'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
<code>invoke_with_call_chain'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/task.rb:176:in</code>block
in invoke_prerequisites'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/task.rb:174:in
<code>each'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/task.rb:174:in</code>invoke_prerequisites'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/task.rb:157:in
<code>block in invoke_with_call_chain'
/home/ubuntu/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in</code>mon_synchronize'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
<code>invoke_with_call_chain'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/task.rb:144:in</code>invoke'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/application.rb:116:in
<code>invoke_task'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/application.rb:94:in</code>block
(2 levels) in top_level'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
<code>each'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/application.rb:94:in</code>block
in top_level'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
<code>standard_exception_handling'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/application.rb:88:in</code>top_level'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/application.rb:66:in
<code>block in run'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/application.rb:133:in</code>standard_exception_handling'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/lib/rake/application.rb:63:in
<code>run'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2.2/bin/rake:33:in</code>'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in <code>load'
/home/ubuntu/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in</code>'
Tasks: TOP => ts:config => thinking_sphinx:configure</p></div>georgegwutag:support.flying-sphinx.com,2011-01-05:Comment/132746792012-01-30T04:21:36Z2012-01-30T04:21:36ZThinkingSphinx ts:rebuild works in dev and test, but error in production mode. <div><p>Hi George</p>
<p>I think this is because the Flying Sphinx gem tries to load in
the Sphinx configuration details when not running in dev or test
environments, but because you're running this locally, the
configuration environment variables that Heroku provides aren't
available.</p>
<p>When you're running this on Heroku, you should be using
fs:rebuild instead of ts:rebuild - what's prompted you to try this
in production locally?</p>
<p>Cheers</p>
<p>Pat</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/132746792012-01-30T14:13:04Z2012-01-30T14:13:04ZThinkingSphinx ts:rebuild works in dev and test, but error in production mode. <div><p>Pat,</p>
<p>After I went past the flying sphinx error on heroku, I still had
orther<br>
problems. So I tried to test locally to isolate the trouble
spot.</p>
<p>Is there a way to test flying sphinx locally with local config
as close to<br>
production as possible?</p>
<p>Thanks,</p></div>George Wutag:support.flying-sphinx.com,2011-01-05:Comment/132746792012-01-31T00:13:52Z2012-01-31T00:13:52ZThinkingSphinx ts:rebuild works in dev and test, but error in production mode. <div><p>Hi George</p>
<p>Try commenting out the flying-sphinx gem in your Gemfile when
using the production env locally. Should allow things to work
normally then.</p>
<p>Cheers</p>
<p>Pat</p></div>Pat Allantag:support.flying-sphinx.com,2011-01-05:Comment/132746792012-01-31T19:53:28Z2012-01-31T19:53:28ZThinkingSphinx ts:rebuild works in dev and test, but error in production mode. <div><p>Hi Pat,</p>
<p>It works. It is a bit kluge.</p>
<p>Can fs gem detect if it is running in Heroku or not and use that
as<br>
indicator instead of not dev or test?</p>
<p>Just a thought.</p>
<p>Thanks,</p>
<p>George</p></div>George Wutag:support.flying-sphinx.com,2011-01-05:Comment/132746792012-02-04T03:13:14Z2012-02-04T03:13:14ZThinkingSphinx ts:rebuild works in dev and test, but error in production mode. <div><p>I've just pushed a commit to <a href=
"http://github.com/flying-sphinx/flying-sphinx">http://github.com/flying-sphinx/flying-sphinx</a>
that does that - I'll get a gem release out soon.</p>
<p>Thanks for the suggestion :)</p></div>Pat Allan