Forum: Ruby on Rails Esoteric error with file_column 0.3.1

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
54532f023496410e0d7b1add5561ba45?d=identicon&s=25 purestorm (Guest)
on 2005-11-18 22:21
(Received via mailing list)
Hi

I'm trying to setup file_column in one of my projects. I have
downloaded the 0.3.1 tarball release and extracted it into vendor/
plugins. I have then tried to use file_column in my Image model as it
has been described in the README.

The first page I get from the webserver (Webrick in development mode)
is fine. However, hitting reload on the same page (using the Image
model) crashes my application. I get this error:

   undefined method `assoc' for class `Magick::ImageList'

The application trace is as follows:

==8<======================================================
#{RAILS_ROOT}opt/local/lib/ruby/site_ruby/1.8/RMagick.rb:1002:in
`undef_method'
#{RAILS_ROOT}opt/local/lib/ruby/site_ruby/1.8/RMagick.rb:1002
#{RAILS_ROOT}/vendor/rails/activerecord/lib/../../activesupport/lib/
active_support/dependencies.rb:206:in `load'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/../../activesupport/lib/
active_support/dependencies.rb:206:in `load'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/../../activesupport/lib/
active_support/dependencies.rb:38:in `require_or_load'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/../../activesupport/lib/
active_support/dependencies.rb:21:in `depend_on'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/../../activesupport/lib/
active_support/dependencies.rb:177:in `require_dependency'
#{RAILS_ROOT}/vendor/rails/activerecord/lib/../../activesupport/lib/
active_support/dependencies.rb:177:in `require_dependency'
#{RAILS_ROOT}/app/models/image.rb:1
#{RAILS_ROOT}/app/controllers/admin/image_controller.rb:10:in `list'
#{RAILS_ROOT}/app/controllers/admin/image_controller.rb:5:in `index'
==8<======================================================

I have a recent install of RMagick (works in another Rails app) and
rails 0.14.2.

It seems to me that the error is related to rails reloading some file
since the error occurs on the second reload.

I'd be grateful about any hints on how to solve this problem.

Regards

Manuel Holtgrewe
54532f023496410e0d7b1add5561ba45?d=identicon&s=25 purestorm (Guest)
on 2005-11-18 22:27
(Received via mailing list)
Please ignore my other email. My problem was caused by having
"require_dependency 'RMagick'" in the controller file. Maybe this
could go into a FAQ, though?

I'm sorry for bothering you.

Regards

Manuel Holtgrewe
648d60296e65a1278017c0b9f960ec3a?d=identicon&s=25 ol1barn3s (Guest)
on 2005-11-19 14:15
(Received via mailing list)
Hi Manuel, I believe this comes from the fact that with plugins you
don't need to require anything?

btw, there's a wiki entry for FileColum now:

http://wiki.rubyonrails.com/rails/pages/HowToUseFileColumn

best
Oliver

2005/11/18, Manuel Holtgrewe <purestorm@ggnore.net>:
This topic is locked and can not be replied to.