I wrote a small app, rails 2.0.2 using attachment_fu and rmagick to
upload files. Everthing works fine in my dev machine ( windows XP ). I
can upload with no problem.
I am using deprec/capistrano to deploy to my slicehost account.
Everthing works fine, but when I try to upload a file, I was getting the
“We’re sorry, but something went wrong.”, so I delete the 500.html error
file from the public folder. I wana see the error, but now, I got a
blank page.
I got this blank page with PNG and JPG, but uploading BMP´s file I got
the error message:
"1 error prohibited this image from being saved
There were problems with the following fields:
* Content type is not included in the list "
I a newbie at rails and linux, maybe I have an issue with nginx or some
rights have to be granted to create images and folder, as u can see,
attachment_fu will try to save them at public/uploads folder, here is my
images model.
could try running it in dev mode temporarily
Jose carlos Da cunha jr wrote:
I a newbie at rails and linux, maybe I have an issue with nginx or some
rights have to be granted to create images and folder, as u can see,
attachment_fu will try to save them at public/uploads folder, here is my
images mode
On Wed, Apr 16, 2008 at 3:37 PM, Jose carlos Da cunha jr <
I was just looking for the log and found this: It seems to be a
permission issue… but there is another thing that I doesn’t
understand… my application is running at releases/20080416173337/
folder? it shouldn´t be at the myapp/current ?
/var/www/apps/nanistore/releases/20080416173337/public/uploads/0000):
My guess is that capistrano is using a timestamp to have different
copies of your app in your server.
Looks to me like you need to make sure that the permissions on
public/uploads/0000 allow for the apache user [or whomever] to write to
it. Possibly they got created by the capistrano user and apache user
doesn’t have write access or what not
I don’t know how to run it as sudo, inside my rails app.
What I did and it worked was run “chmod 777 uploads” command, so I
gave full access to the directory.
I am not sure this is the best way, but it works, while a look for way
to fix it.
There is something odd here, where should my app run? I have a current
folder and several releases folder. Why my app is pointing to a specific
release 20080416173337 folder?
I am using capistrano/deprec, they are awesome. But I must understand
a little bit more about them.
Anyway, I google lots of attachment_fu tutorial, didn´t see nobody
complaing about this permission denied.
You should not put the uploads into your relase, but rather into a
subdirectory of the /shared directory that cap setup creates for
you. This folder you then symlink to RAILS_ROOT/public/uploads in your
capistrano recipe. Otherwise you’ll lose all your old uploads with the
next deploy. See this railscast
for details. Then make sure your deploy user is the owner of your
uploads folder, for example:
sudo chown deploy /shared/uploads