RMagick load problems?

I have a page (model: daily_progress_chart) that uses RMagick and
ImageMagick to create a chart using RVG. A few days ago (after some
updates to Rails), this chart stopped working on both my development
machine (MacBook Pro) and the production server (Gentoo Linux). I get
the following error messages. I am totally lost, but I assume that there
is a problem with RMagick. Any ideas anyone?

On the MacBook:

(Note that “parent_of?” is defined and was working fine until I went
to this page. As soon as I try to generate a chart (even a blank one), a
lot of things seem to get disconnected and suddenly instance methods
that were working fine on another page don’t work at all. Also, mongrel
hangs when I try to reboot it, taking over a minute to restart.)

From the development log:

NoMethodError (undefined method parent_of?' for #<District:0x3412780>): /vendor/rails/activerecord/lib/active_record/base.rb:1847:inmethod_missing’
/app/models/project.rb:59:in parent_of?' /vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:127:ineach’
/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:127:in
send' /vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:127:inmethod_missing’
/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:98:in
method_missing' /app/models/project.rb:55:inparent_of?’
/app/models/project.rb:66:in parent_or_self?' /vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:127:insend’
/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:127:in
method_missing' /app/models/user.rb:90:inmember_of?’
/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:127:in
each' /vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:127:insend’
/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:127:in
method_missing' /vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb:91:inmethod_missing’
/app/models/user.rb:89:in member_of?' /app/controllers/application.rb:25:inset_organization’
/vendor/rails/actionpack/lib/action_controller/filters.rb:456:in
send' /vendor/rails/actionpack/lib/action_controller/filters.rb:456:incall’
/vendor/rails/actionpack/lib/action_controller/filters.rb:435:in
call' /vendor/rails/actionpack/lib/action_controller/filters.rb:640:incall_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:637:in
call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:641:incall_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in
call' /vendor/rails/actionpack/lib/action_controller/filters.rb:640:incall_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:641:in
call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:438:incall’
/vendor/rails/actionpack/lib/action_controller/filters.rb:640:in
call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:641:incall_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in
call' /vendor/rails/actionpack/lib/action_controller/filters.rb:640:incall_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:622:in
perform_action_without_benchmark' /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:inperform_action_without_rescue’
/usr/local/lib/ruby/1.8/benchmark.rb:293:in measure' /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:inperform_action_without_rescue’
/vendor/rails/actionpack/lib/action_controller/rescue.rb:111:in
perform_action' /vendor/rails/actionpack/lib/action_controller/base.rb:427:insend’
/vendor/rails/actionpack/lib/action_controller/base.rb:427:in
process_without_filters' /vendor/rails/actionpack/lib/action_controller/filters.rb:627:inprocess_without_session_management_support’
/vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in
process' /vendor/rails/actionpack/lib/action_controller/base.rb:330:inprocess’
/vendor/rails/railties/lib/dispatcher.rb:41:in dispatch' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:84:inprocess’
/usr/local/lib/ruby/1.8/sync.rb:229:in synchronize' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:83:inprocess’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:580:in
process_client' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:579:ineach’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:579:in
process_client' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:inrun’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in
initialize' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:innew’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in
run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:ininitialize’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:in
new' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:inrun’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:267:in
run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:266:ineach’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:266:in
run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:127:inrun’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/command.rb:211:in
run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:231 /usr/local/bin/mongrel_rails:18:inload’
/usr/local/bin/mongrel_rails:18

Rendering
/private/var/www/xxx.org/config/…/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.rhtml
(internal_server_error)

I don’t know if this is a Mongrel problem or an RMagick problem, but it
only happens when I try to make a chart.

Meanwhile, the server output looks like this:

Mon Nov 20 09:16:45 -0800 2006: Error calling Dispatcher.dispatch
#<NameError: cannot remove Object::BlackmanFilter>
/private/var/www/xxx.org/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:416:in
remove_const' /private/var/www/xxx.org/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:416:insend’
/private/var/www/xxx.org/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:416:in
remove_constant' /private/var/www/xxx.org/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:270:inremove_unloadable_constants!’
/private/var/www/xxx.org/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:270:in
each' /private/var/www/xxx.org/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:270:inremove_unloadable_constants!’
/private/var/www/xxx.org/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:73:in
clear' /private/var/www/xxx.org/config/../vendor/rails/railties/lib/dispatcher.rb:59:inreset_application!’
/private/var/www/xxx.org/config/…/vendor/rails/railties/lib/dispatcher.rb:111:in
reset_after_dispatch' /private/var/www/xxx.org/config/../vendor/rails/railties/lib/dispatcher.rb:51:indispatch’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:84:in
process' /usr/local/lib/ruby/1.8/sync.rb:229:insynchronize’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:83:in
process' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:580:inprocess_client’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:579:in
each' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:579:inprocess_client’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in
run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:ininitialize’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in
new' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:inrun’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:in
initialize' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:innew’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:in
run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:267:inrun’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:266:in
each' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:266:inrun’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:127:in
run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/command.rb:211:inrun’
/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:231
/usr/local/bin/mongrel_rails:18:in `load’
/usr/local/bin/mongrel_rails:18

And when I try to restart, I get this:

Mon Nov 20 01:13:16 -0800 2006: Reaping 1 threads for slow workers
because of ‘shutdown’
Waiting for 1 requests to finish, could take 60 seconds.Mon Nov 20
01:13:22 -0800 2006: Reaping 1 threads for slow workers because of
‘shutdown’
Waiting for 1 requests to finish, could take 60 seconds.Mon Nov 20
01:13:28 -0800 2006: Reaping 1 threads for slow workers because of
‘shutdown’
Waiting for 1 requests to finish, could take 60 seconds.Mon Nov 20
01:13:34 -0800 2006: Reaping 1 threads for slow workers because of
‘shutdown’
Waiting for 1 requests to finish, could take 60 seconds.Mon Nov 20
01:13:40 -0800 2006: Reaping 1 threads for slow workers because of
‘shutdown’
Waiting for 1 requests to finish, could take 60 seconds.Mon Nov 20
01:13:46 -0800 2006: Reaping 1 threads for slow workers because of
‘shutdown’
Waiting for 1 requests to finish, could take 60 seconds.Mon Nov 20
01:13:52 -0800 2006: Reaping 1 threads for slow workers because of
‘shutdown’
Waiting for 1 requests to finish, could take 60 seconds.Mon Nov 20
01:13:58 -0800 2006: Reaping 1 threads for slow workers because of
‘shutdown’
Waiting for 1 requests to finish, could take 60 seconds.Mon Nov 20
01:14:04 -0800 2006: Reaping 1 threads for slow workers because of
‘shutdown’
Waiting for 1 requests to finish, could take 60 seconds.Mon Nov 20
01:14:10 -0800 2006: Reaping 1 threads for slow workers because of
‘shutdown’
Waiting for 1 requests to finish, could take 60 seconds.Mon Nov 20
01:14:16 -0800 2006: Reaping 1 threads for slow workers because of
‘shutdown’
Thread #<Thread:0x3483ffc sleep> is too old, killing.
Waiting for 1 requests to finish, could take 60 seconds.Loaded suite
/usr/local/bin/mongrel_rails
Started

Finished in 0.000216 seconds.

0 tests, 0 assertions, 0 failures, 0 errors

On the Gentoo server, I get an application error immediately when I try
to go to the page that loads RMagick. In the controller I have:

def new
@new_params = { :type_of_chart => “dprs” }
@daily_progress_chart = DailyProgressChart.new(@new_params)
end

daily_progress_chart.rb begins:

require ‘rvg/rvg’
require ‘RMagick’
include Magick

class DailyProgressChart < ActiveRecord::Base

The chart is not generated until save, so I presume the problem is one
of loading the required files. Here is what the production log says:

Processing DailyProgressChartsController#new (for 164.116.22.137 at
2006-11-20 09:22:38) [GET]
Session ID: adc0f2f2020d751f1b73c68142ccd209
Parameters: {“action”=>“new”, “controller”=>“daily_progress_charts”}

LoadError (Expected
/var/www/xxx.org/current/config/…/app/models/daily_progress_chart.rb to
define DailyProgressChart):
/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:246:in
load_missing_constant' /vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:446:inconst_missing’
/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:458:in
const_missing' /vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:257:inload_missing_constant’
/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:462:in
const_missing' /app/controllers/daily_progress_charts_controller.rb:78:innew’
/vendor/rails/actionpack/lib/action_controller/base.rb:1070:in
send' /vendor/rails/actionpack/lib/action_controller/base.rb:1070:inperform_action_without_filters’
/vendor/rails/actionpack/lib/action_controller/filters.rb:635:in
call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:641:incall_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in
call' /vendor/rails/actionpack/lib/action_controller/filters.rb:640:incall_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:637:in
call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:641:incall_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in
call' /vendor/rails/actionpack/lib/action_controller/filters.rb:640:incall_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:641:in
call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:438:incall’
/vendor/rails/actionpack/lib/action_controller/filters.rb:640:in
call_filter' /vendor/rails/actionpack/lib/action_controller/filters.rb:641:incall_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in
call' /vendor/rails/actionpack/lib/action_controller/filters.rb:640:incall_filter’
/vendor/rails/actionpack/lib/action_controller/filters.rb:622:in
perform_action_without_benchmark' /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:inperform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:inperform_action_without_rescue’
/vendor/rails/actionpack/lib/action_controller/rescue.rb:111:in
perform_action' /vendor/rails/actionpack/lib/action_controller/base.rb:427:insend’
/vendor/rails/actionpack/lib/action_controller/base.rb:427:in
process_without_filters' /vendor/rails/actionpack/lib/action_controller/filters.rb:627:inprocess_without_session_management_support’
/vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in
process' /vendor/rails/actionpack/lib/action_controller/base.rb:330:inprocess’
/vendor/rails/railties/lib/dispatcher.rb:41:in dispatch' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:84:inprocess’
/usr/lib/ruby/1.8/sync.rb:229:in synchronize' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/rails.rb:83:inprocess’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:580:in
process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:579:ineach’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:579:in
process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:inrun’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in
initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:innew’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:686:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:ininitialize’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:in
new' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel.rb:673:inrun’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:267:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:266:ineach’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/configurator.rb:266:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:127:inrun’
/usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/lib/mongrel/command.rb:211:in
run' /usr/lib/ruby/gems/1.8/gems/mongrel-0.3.13.4/bin/mongrel_rails:231 /usr/bin/mongrel_rails:18:inload’
/usr/bin/mongrel_rails:18

Rendering /var/www/xxx.org/current/config/…/public/500.html (500
Internal Server Error)

I have no idea if these are the same problems or different problems. I’m
fairly certain the problem is with RMagick (else why not on any other
page?). Not finding some header files? Something changed? Anyone else
having this problem?

Thanks for any and all help.

Charles F. Munat
Seattle

Maybe i’m missing something (i’m not particularly familiar with rmagick)
but it seems weird to do include Magick at the top of the file (ie not
inside some class)

Fred

Frederick C. wrote:

Maybe i’m missing something (i’m not particularly familiar with rmagick)
but it seems weird to do include Magick at the top of the file (ie not
inside some class)

Fred

That’s the way I’ve always done it and it works fine. Is that wrong?

Chas.

Update:

I determined that the problem on the Gentoo server was that ImageMagick
had been updated using emerge to 6.3.0 but RMagick was still compiled
for 6.2.9.

Still trying to figure out why RMagick is failing on the MacBook…

Can anyone tell me why I get the errors I get? Why do methods on loaded
objects suddenly stop working? Is it because Mongrel is hanging (some
thread is stuck). I assume the thread problem is because of some change
to ImageMagick or RMagick…

Life sure is exciting when error messages are cryptic.

Thanks for any and all help.

Chas.

Frederick C. wrote:

I’m not entirely sure. I’m just not entirely of the effect of that
statement, i.e. when it’s at the top level like that, exactly what is
the module being included in ?

Fred

I think it is just making the libraries available to the interpreter. I
looked for some documentation on this and found this page:

http://pub.cozmixng.org/~the-rwiki/rw-cgi.rb?cmd=view;name=RubyCodingConvention

Which seems to say that the way I have it is correct.

What is most important to me is that it works!

Thanks for the help.

Chas.

Charles M. wrote:

Frederick C. wrote:

Maybe i’m missing something (i’m not particularly familiar with rmagick)
but it seems weird to do include Magick at the top of the file (ie not
inside some class)

Fred

That’s the way I’ve always done it and it works fine. Is that wrong?

I’m not entirely sure. I’m just not entirely of the effect of that
statement, i.e. when it’s at the top level like that, exactly what is
the module being included in ?

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs