# Troubles with Flex Image plugin

**URL:** <https://www.ruby-forum.com/t/troubles-with-flex-image-plugin/149165>\
**Category:** Rails\
**Created:** [September 22, 2008, 5:58am UTC](https://www.ruby-forum.com/t/troubles-with-flex-image-plugin/149165 "2008-09-22T05:58:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/90ced4/32.png) [@maep](https://www.ruby-forum.com/u/maep)\
**Post date:** [September 22, 2008, 5:58am UTC](https://www.ruby-forum.com/t/troubles-with-flex-image-plugin/149165/1 "2008-09-22T05:58:25Z")

</div>

Hi! I am learning to use rails, and I want to use Fleximage plugin.  
But I can’t see how nice it is, because I can’t make it work.

So, what i have…  
model “account” with blob field “image\_file\_data”,  
account acts\_as\_fleximage.

I installed ImageMagic and RMagic, I use InstantRails 2.0.

Everything seems to work, before I try ry save record…  
When i submit form, i get error:  
“unable to open image `emp/CGI.2844.10’: No such file or directory”

Thank you in advance!

here is the code:  
(EDIT VIEW)

\<% form\_for(@account, :html =\> { :multipart =\> true }) do |f| %\>  
…

**Upload Image**  
\<%= f.file\_field :image\_file %\>  
or URL: \<%= f.text\_field :image\_file\_url %\>

\<%= f.submit "Update" %\>

\<% end %\>

(CONTROLLER)

def update  
params[:account][:city\_id]= params[:city][:id]  
@account = Account.find(params[:id])  
respond\_to do |format|  
if @account.update\_attributes(params[:account])  
flash[:notice] = ‘Account was successfully updated.’  
format.html { redirect\_to(@account) }  
format.xml { head :ok }  
else  
format.html { render :action =\> “edit” }  
format.xml { render :xml =\> @account.errors, :status =\>  
:unprocessable\_entity }  
end  
end  
end

error:  
"unable to open image `emp/CGI.2844.10': No such file or directory" ... vendor/plugins/fleximage/lib/fleximage/model.rb:224:in`read’  
vendor/plugins/fleximage/lib/fleximage/model.rb:224:in `image_file=' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2117:in`send’  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active\_record/base.rb:2117:in  
`attributes=' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2116:in`each’  
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active\_record/base.rb:2116:in  
`attributes=' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:2033:in`update\_attributes’  
…  
Request

Parameters:

{“city”=\>{“id”=\>“1”},  
“commit”=\>“Update”,  
“account”=\>{“birthday(2i)”=\>“9”,  
“image\_file”=\>#\<File:C:/WINDOWS/Temp/CGI.2844.10\>,  
“birthday(3i)”=\>“17”,  
“image\_file\_url”=\>"",  
“name1”=\>“adasd”,  
“name2”=\>“asdasd”,  
“city\_id”=\>“1”,  
“name3”=\>“asasd”,  
“birthday(1i)”=\>“2008”},  
“\_method”=\>“put”,  
“authenticity\_token”=\>“adf9d72796dc8b9adb3fe92fee5b06322ac44bfd”,
