Ferret problems with Rails 1.2.1


#1

Hi, I’ve just updated rails from 1.1.6 to 1.2.1 and I’m getting the
following errors whenever I load a page that uses a class that uses
ferret. I have ferret 0.10.13 and acts_as_ferret. They were working
fine before the upgrade.

#<NameError: cannot remove Object::WildcardQuery>
["/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:423:in
remove_const'", "/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:423:inremove_constant’",
“/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:274:in
remove_unloadable_constants!'", "/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:274:inremove_unloadable_constants!’”,
“/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:73:in
clear'", "/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/dispatcher.rb:60:inreset_application!’”,
“/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/dispatcher.rb:116:in
reset_after_dispatch'", "/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/dispatcher.rb:51:indispatch’”,
“/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/webrick_server.rb:113:in
handle_dispatch'", "/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/webrick_server.rb:79:inservice’”, “/usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in
service'", "/usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:inrun’”,
“/usr/local/lib/ruby/1.8/webrick/server.rb:173:in start_thread'", "/usr/local/lib/ruby/1.8/webrick/server.rb:162:instart_thread’”,
“/usr/local/lib/ruby/1.8/webrick/server.rb:95:in start'", "/usr/local/lib/ruby/1.8/webrick/server.rb:92:instart’”,
“/usr/local/lib/ruby/1.8/webrick/server.rb:23:in start'", "/usr/local/lib/ruby/1.8/webrick/server.rb:82:instart’”,
“/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/webrick_server.rb:63:in
dispatch'", "/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/commands/servers/webrick.rb:59", "/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’”,
“/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:496:in
require'", "/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:343:innew_constants_in’”,
“/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:496:in
require'", "/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/commands/server.rb:39", "/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’”,
“/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:496:in
require'", "/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:343:innew_constants_in’”,
"/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:496:in
require'", "script/server:3"] [2007-01-23 11:50:29] ERROR/market/list’ not found.
192.168.1.102 - - [23/Jan/2007:11:50:29 PST] “GET /market/list HTTP/1.1”
404 283

  • -> /market/list

Have you seen this? Thanks.


#2

Hi,

In case it’s any use, I moved a Rails 1.1.6 site to 1.2.1 the other day
with Ferret 0.10.14 and it’s working fine, though it doesn’t use
acts_as_ferret.

The dependencies system has changed in Rails 1.2, perhaps acts_as_ferret
is tickled by this. You might want to try including the Ferret
libraries manually, in config/environment.rb.

http://weblog.rubyonrails.org/2006/8/11/reloading-revamped

John.

http://johnleach.co.uk


#3

On Wed, Jan 24, 2007 at 11:39:45PM +0000, John L. wrote:

http://weblog.rubyonrails.org/2006/8/11/reloading-revamped
I have a live application here running aaf trunk, Rails 1.2.1 and Ferret
0.10.14 without problems. I’m not running Mongrel, though.

But it really looks like some dependencies issue. can you make sure
there is no other version of ferret lying around? It’d be also
interesting to know where ferret is installed (systemwide or frozen to
your app).

Jens


webit! Gesellschaft für neue Medien mbH www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer removed_email_address@domain.invalid
Schnorrstraße 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66


#4

I bit OT I know, but let me ask

On 1/31/07, donut donut removed_email_address@domain.invalid wrote:

… May be I should stay with 1.1.6 as 1.2.1 is at
least 50% slower than 1.1.6.

Are you sure? The exact figure isn’t what concerns me, but what did
you notice in terms of performance, and how?

Thanks


#5

Jens K. wrote:

On Wed, Jan 24, 2007 at 11:39:45PM +0000, John L. wrote:

http://weblog.rubyonrails.org/2006/8/11/reloading-revamped
I have a live application here running aaf trunk, Rails 1.2.1 and Ferret
0.10.14 without problems. I’m not running Mongrel, though.

But it really looks like some dependencies issue. can you make sure
there is no other version of ferret lying around? It’d be also
interesting to know where ferret is installed (systemwide or frozen to
your app).

Jens

Well I finally got around to testing this again after finishing a work
item today. I upgraded my ferret gem from 0.10.13 to 0.10.14. I also
installed acts_as_ferret 0.3.1 as a gem today(it wasn’t available as a
gem before). I added

require ‘acts_as_ferret’

in my environment.rb and my project ran in rails 1.1.6 fine. Next I
switched to rails 1.2.1(changed RAILS_GEM_VERSION = ‘1.2.1’ in
environment.rb) and did a rake rails:update (which didn’t do anything
related to my problem, I think). Ferret now seems to be working.
However, I’m getting another error:

#<NameError: cannot remove Object::HWBColorspace>
["/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:423:in
remove_const'", "/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:423:inremove_constant’",
“/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:274:in
remove_unloadable_constants!'", "/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:274:inremove_unloadable_constants!’”,
“/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.0/lib/active_support/dependencies.rb:73:in
clear'", "/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/dispatcher.rb:60:inreset_application!’”,
“/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.1/lib/dispatcher.rb:116:in
`reset_after_dispatch’”,
blah blah blah

HWBColorspace is part of the Rmagick gem. I think rails 1.2.1 breaks a
lot of backward compatibility. Now I need to decide if I want to
upgrade my Rmagick gem and hope that I won’t run into another
compatibility problem. May be I should stay with 1.1.6 as 1.2.1 is at
least 50% slower than 1.1.6.

Thanks.


#6

On Tue, Jan 30, 2007 at 08:24:45PM +0100, donut donut wrote:
[…]

related to my problem, I think). Ferret now seems to be working.
However, I’m getting another error:

#<NameError: cannot remove Object::HWBColorspace>
[…]

HWBColorspace is part of the Rmagick gem. I think rails 1.2.1 breaks a
lot of backward compatibility. Now I need to decide if I want to
upgrade my Rmagick gem and hope that I won’t run into another
compatibility problem.

I doubt that updating the gem will solve your problem. Rails 1.2 just
has a different way of how it deals with dependencies - afair the main
difference is that it does not try as hard as older versions to resolve
missing classes - so maybe you are missing a require somewhere?

Jens


webit! Gesellschaft für neue Medien mbH www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer removed_email_address@domain.invalid
Schnorrstraße 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66


#7

It doesn’t seem to be common knowledge yet but are you running the
engines plugin? If so it needs to be updated to use rails 1.2+. And,
if you’re using login_engine and/or user_engine they will need to be
removed. In other words, you can’t use login_engine or user_engine and
rails 1.2+. And the engined plugin is what caused similar errors for
me.


#8

Are you sure? The exact figure isn’t what concerns me, but what did
you notice in terms of performance, and how?

Thanks

“Slower” is vague as there are many ways such as memory, rps, response
time etc to measure perf. Anyway, I came across this:

http://www.ruby-forum.com/topic/95947#new