# File\_column undefined method \`data\_relative\_path'

**URL:** <https://www.ruby-forum.com/t/file-column-undefined-method-data-relative-path/105793>\
**Category:** Rails\
**Created:** [June 2, 2007, 8:17pm UTC](https://www.ruby-forum.com/t/file-column-undefined-method-data-relative-path/105793 "2007-06-02T20:17:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiajv\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cc9497/32.png) [@jiajv\_S](https://www.ruby-forum.com/u/jiajv_S)\
**Post date:** [June 2, 2007, 8:17pm UTC](https://www.ruby-forum.com/t/file-column-undefined-method-data-relative-path/105793/1 "2007-06-02T20:17:36Z")

</div>

i use file\_column0.31 and rmagick1.141  
i often got the error “undefined method `data\_relative\_path’ for  
#Photo:0x6da7568” when the page display image.

i print some debug info ,when display natural:  
in============================================url\_for\_file\_column  
object============================================#Photo:0x6c9d0b4  
photo.data============================================./script/…/config/…/p

ubl  
ic/photo/data/24/850A63B034A4FAB73.jpg  
object.methods.grep(/method/)=====================data\_just\_uploaded?,data\_op

tio  
ns,data\_relative\_path,data\_dir,data\_relative\_dir,data\_temp,data\_temp=,data,da

ta=  
,data\_magick\_after\_assign  
method============================================data  
subdir============================================thumb  
relative\_path==================24/thumb/850A63B034A4FAB73.jpg

and this is error  
in============================================url\_for\_file\_column  
object============================================#Photo:0x6d97938  
photo.data============================================850A63B034A4FAB73.jpg  
object.methods.grep(/method/)=====================data?,data  
method============================================data  
subdir============================================thumb  
i suppose the method “data\_relative\_path” cant be found.  
version:  
ruby 1.8.5 (2006-08-25) [i386-mswin32]  
Rails 1.2.3

my sourcecode:

photo.rb  
class Photo \< ActiveRecord::Base  
validates\_format\_of :data,  
:with=\>/^.\*(.jpg|.JPG|.gif|.GIF)$/,  
:message =\> “ä½ åªèƒ½ä¸Šä¼ JPGæˆ–åˆ™GIFçš„å›¾ç‰‡æ–‡ä»¶”  
file\_column :data, :magick =\> {  
:versions =\> { “thumb” =\> “50x50\>”, “medium” =\> “640x480\>” }  
}

belongs\_to:user  
belongs\_to:entry  
end

in \*\*.rhtml  
\<%= image\_tag url\_for\_file\_column ‘photo’, ‘data’ %\>

at [rubyforge.com](http://rubyforge.com) i found rmagick-1.14.1-win32.gem  
and rmagick-1.15.6.gem ,iused  
rmagick-1.14.1-win32.gem ;  
and what is the difference???
