Welcome Guest | Login

Image upload and filesystem storing

I am having problems with the image upload part of my app. It uses a REST approach with attachement_fu as well as mini magick. On my local pc, it works fine but on the server, the attachment fu seems to be not working. The image is not stored on the server and nothing gets
added in the model.

Any ideas ?

Thanks

2007-12-12 06:16 PM

jer
As it turns out this problem was solved by switching to Mongrel.   Some mysterious way that FastCGI interacts with apache messed with RESTful image uploads with attachment_fu (both mini-magick and rmagick processor) for this application.

2007-12-13 12:49 AM

Thanks William, now I am trying to restart my Mongrel instance and I get an error.

LoadError (Expected /home/luluswa/tsp/app/models/asset.rb to define Asset):

2007-12-13 07:07 PM

jer
Hmm - maybe change the processor in your assets.rb model (to rmagick or MiniMagick, whichever is not selected).  You should also check permissions to make sure the folders are chmod 755 and files chmod 664.

Cheers,
~William

2007-12-13 07:13 PM

I only changed the resize parameter in the asset model, then I ftp my file over and restart
mongrel and got that error.

The weird thing is that it was working a minute ago before I submitted my changes.

Thanks

2007-12-13 07:20 PM

jer
Check the permissions of the file (664) - it may also have been corrupted in the transfer.  I'd suggest trying sFTP (and make sure you're not in binary mode).  

2007-12-13 08:01 PM

I did but no change.

I wonder if fastcgi is still running on it.

2007-12-13 09:06 PM

jer
It looks like to be an issue with the "MiniMagick" gem installed. I've tried switching it to "Rmagick" and the sites are now showing up the images. Also I've successfully uploaded a test image.

2007-12-14 12:38 AM

I am using Rmagick now. Maybe its the way I stop and start mongrel

> mongrel_rails stop

> mongrel_rails start -e production -p 4216 -d

Is this the correct way to reboot mongrel after a change has been made in the app ?

Thanks

2007-12-14 06:45 AM

jer
Yes, that is correct. You can also use the following ways:

[~] cd yourapp
[~/yourapp] mongrel_rails restart  

OR

[~] kill <your process id number>
[~] cd yourapp
[~/yourapp] mongrel_rails start -e production -p 4*** -d

2007-12-14 07:06 AM

It seems to be some sort of file corruption on the server.

1 - How long does it take once the file is ftp to see the changes on
the server ?

2 - Is going to my_app/log/production.log file the right place to see
an app errors ?

Thank you

2007-12-15 11:11 AM

jer
>How long does it take once the file is ftp to see the changes on the server ?
It will get updated directly at the same time. Also note that if you are modifying your app, you may need to kill dispatch.fcgi or restart the mongrel instance so the changes will take effect.

>Is going to my_app/log/production.log file the right place to see an app errors ?
Yes, if you are running your app in production mode, then errors are logged in production.log.

2007-12-15 11:23 AM

I dunno I think my mongrel instance is not firing up correctly since my code works locally, I think the refresh might not be happening.

Thanks

2007-12-15 11:25 AM

jer
You may take a look at the ~app/log/mongrel.log to see why it's not firing up. That should help tracing the actual problem.

2007-12-15 11:57 AM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!