I am running ferret (0.11.4) and acts_as_ferret (stable from svn) in a rails 1.2.3 app in production using the DRb server. I recently upgraded my configuration and the method with which I start and stop the server no longer works: Here is the command I would like to use (and have used in the past) to start the aaf server: $ /Library/WebServer/rails/ccdb/current/script/runner -e production /Library/WebServer/rails/ccdb/current/script/ferret_start /opt/local/lib/ruby/1.8/drb/drb.rb:736:in `open'': druby://localhost:9090 - #<Errno::ECONNREFUSED: Connection refused - connect(2)> (DRb::DRbConnError) from /opt/local/lib/ruby/1.8/drb/drb.rb:729:in `each'' from /opt/local/lib/ruby/1.8/drb/drb.rb:729:in `open'' from /opt/local/lib/ruby/1.8/drb/drb.rb:1189:in `initialize'' from /opt/local/lib/ruby/1.8/drb/drb.rb:1169:in `new'' from /opt/local/lib/ruby/1.8/drb/drb.rb:1169:in `open'' from /opt/local/lib/ruby/1.8/drb/drb.rb:1085:in `method_missing'' from /opt/local/lib/ruby/1.8/drb/drb.rb:1103:in `with_friend'' from /opt/local/lib/ruby/1.8/drb/drb.rb:1084:in `method_missing'' ... 28 levels... from /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/railties/lib/commands/runner.rb:39:in `require'' from /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/railties/lib/commands/runner.rb:39 from /Library/WebServer/rails/ccdb/current/script/runner:3:in `require'' from /Library/WebServer/rails/ccdb/current/script/runner:3 Strangely the follwoing command works: $ cd /Library/WebServer/rails/ccdb/current && RAILS_ENV=production /Library/WebServer/rails/ccdb/current/script/ferret_start Starting ferret DRb server...Done. I would simply switch to that but I am on an Xserve and I''m using launchd to start the aaf server on reboot. launchd does not seem to like the command that works. Anyone know why I would get a DRbConnError when using script/runner? Thanks in advance, Tom -- Posted via http://www.ruby-forum.com/.
Hi! most probably this happens because with script/runner, your model classes get loaded before the server gets a chance to tell them they shouldn''t run in remote mode. Hence aaf tries to connect to the DRb server, which of course is impossible since it hasn''t been started up yet, resulting in the error you see. Try to set the environment variable FERRET_USE_LOCAL_INDEX to ''true'' in your launch command: $ FERRET_USE_LOCAL_INDEX=true /Library/WebServer/rails/ccdb/current/script/runner -e production /Library/WebServer/rails/ccdb/current/script/ferret_start cheers, Jens On Fri, Oct 05, 2007 at 06:07:47AM +0200, Tom Brice wrote:> I am running ferret (0.11.4) and acts_as_ferret (stable from svn) in a > rails 1.2.3 app in production using the DRb server. I recently upgraded > my configuration and the method with which I start and stop the server > no longer works: Here is the command I would like to use (and have used > in the past) to start the aaf server: > > $ /Library/WebServer/rails/ccdb/current/script/runner -e production > /Library/WebServer/rails/ccdb/current/script/ferret_start > /opt/local/lib/ruby/1.8/drb/drb.rb:736:in `open'': druby://localhost:9090 > - #<Errno::ECONNREFUSED: Connection refused - connect(2)> > (DRb::DRbConnError) > from /opt/local/lib/ruby/1.8/drb/drb.rb:729:in `each'' > from /opt/local/lib/ruby/1.8/drb/drb.rb:729:in `open'' > from /opt/local/lib/ruby/1.8/drb/drb.rb:1189:in `initialize'' > from /opt/local/lib/ruby/1.8/drb/drb.rb:1169:in `new'' > from /opt/local/lib/ruby/1.8/drb/drb.rb:1169:in `open'' > from /opt/local/lib/ruby/1.8/drb/drb.rb:1085:in `method_missing'' > from /opt/local/lib/ruby/1.8/drb/drb.rb:1103:in `with_friend'' > from /opt/local/lib/ruby/1.8/drb/drb.rb:1084:in `method_missing'' > ... 28 levels... > from > /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/railties/lib/commands/runner.rb:39:in > `require'' > from > /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/railties/lib/commands/runner.rb:39 > from /Library/WebServer/rails/ccdb/current/script/runner:3:in > `require'' > from /Library/WebServer/rails/ccdb/current/script/runner:3 > > Strangely the follwoing command works: > > $ cd /Library/WebServer/rails/ccdb/current && RAILS_ENV=production > /Library/WebServer/rails/ccdb/current/script/ferret_start > Starting ferret DRb server...Done. > > I would simply switch to that but I am on an Xserve and I''m using > launchd to start the aaf server on reboot. launchd does not seem to > like the command that works. > > Anyone know why I would get a DRbConnError when using script/runner? > > Thanks in advance, > Tom > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk >-- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa
Jens Kraemer wrote:> ...> Try to set the environment variable FERRET_USE_LOCAL_INDEX to ''true'' in > your launch command: > > $ FERRET_USE_LOCAL_INDEX=true > /Library/WebServer/rails/ccdb/current/script/runner -e production > /Library/WebServer/rails/ccdb/current/script/ferret_start >Thanks for the quick reply. Unfortunately that did not work. Different error however: $ FERRET_USE_LOCAL_INDEX=true /Library/WebServer/rails/ccdb/current/script/runner -e production /Library/WebServer/rails/ccdb/current/script/ferret_start /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/railties/lib/commands/runner.rb:45: /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'': no such file to load -- ./../config/boot (MissingSourceFile) from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `require'' from /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:in `require'' from /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in'' from /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:in `require'' from (eval):21 Any advice? Again thanks for the assistance. I have a feeling this is related to the server platform (OS X Server 10.4.10). Do people on Linux get these kind of errors? Tom -- Posted via http://www.ruby-forum.com/.
Hi! I just committed a slight change to the ferret_start script which should fix this. Here''s the changeset: http://projects.jkraemer.net/acts_as_ferret/changeset/252 You''ll still need the FERRET_USE_LOCAL_INDEX environment variable, however. Cheers, Jens On Fri, Oct 05, 2007 at 08:52:34PM +0200, Tom Brice wrote:> Jens Kraemer wrote: > > ...> Try to set the environment variable FERRET_USE_LOCAL_INDEX to ''true'' in > > your launch command: > > > > $ FERRET_USE_LOCAL_INDEX=true > > /Library/WebServer/rails/ccdb/current/script/runner -e production > > /Library/WebServer/rails/ccdb/current/script/ferret_start > > > > Thanks for the quick reply. Unfortunately that did not work. Different > error however: > > $ FERRET_USE_LOCAL_INDEX=true > /Library/WebServer/rails/ccdb/current/script/runner -e production > /Library/WebServer/rails/ccdb/current/script/ferret_start > /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/railties/lib/commands/runner.rb:45: > /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'': no such file to load -- ./../config/boot > (MissingSourceFile) > from > /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > from > /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:in > `require'' > from > /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:342:in > `new_constants_in'' > from > /Library/WebServer/rails/ccdb/current/script/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:495:in > `require'' > from (eval):21 > > Any advice? > > Again thanks for the assistance. I have a feeling this is related to > the server platform (OS X Server 10.4.10). Do people on Linux get these > kind of errors? > > Tom > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk >-- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa
Jens Kraemer wrote:> Hi! > > I just committed a slight change to the ferret_start script which should > fix this.Thanks a bunch Jens! I will give it a go and report back. Tom -- Posted via http://www.ruby-forum.com/.
Jens Kraemer wrote:> Hi! > > I just committed a slight change to the ferret_start script which should > fix this. > > Here''s the changeset: > http://projects.jkraemer.net/acts_as_ferret/changeset/252 > > You''ll still need the FERRET_USE_LOCAL_INDEX environment variable, > however. > > Cheers, > JensFIXED! Works like a charm now. That really makes my week. Adding aaf search was so simple and now that this minor inconvienence is fixed I''m a happy programmer. Thanks for creating such a great tool. Tom -- Posted via http://www.ruby-forum.com/.