By threadhead
I am not able to get file uploads working under Nginx with PassengerL. I am using Carrierwave as the uploader, but that shouldn’t make a difference.
The error on the production.log:
F, [2014-10-31T14:05:41.938864 #16078] FATAL -- :
Errno::ENOENT (No such file or directory - identify):
app/controllers/adults_controller.rb:44:in `update'
There are no errors in /var/log/nginx/errors.log
Her is my server Nginx site config:
server {
listen 80;
server_name www.mysite.in;
root /home/deploy/mysite/current/public;
passenger_enabled on;
passenger_ruby /home/deploy/.rvm/gems/ruby-2.1.4/wrappers/ruby;
passenger_user deploy;
}
server {
listen 443 ssl;
server_name www.mysite.in;
root /home/deploy/mysite/current/public;
passenger_enabled on;
passenger_ruby /home/deploy/.rvm/gems/ruby-2.1.4/wrappers/ruby;
passenger_user deploy;
ssl on;
ssl_certificate /etc/nginx/ssl/www_mysite_in.crt;
ssl_certificate_key /etc/nginx/ssl/myserver.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#Disables all weak ciphers
ssl_ciphers 'AES256+EECDH:AES256+EDH';
# Specifies that server ciphers should be preferred over client (e.g. browser) ciphers when using SSL/TLS.
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.4.4 8.8.8.8 valid=300s;
resolver_timeout 10s;
passenger_set_cgi_param HTTP_X_FORWARDED_PROTO https;
}
I can verify that the upload is received and saved into /tmp
-rw------- 1 deploy deploy 7093 Oct 31 17:21 RackMultipart20141031-11691-14busua
-rw------- 1 deploy deploy 7093 Oct 31 17:21 mini_magick20141031-11691-w6gmhc.gif
And I double-checked the permission on /tmp
drwxrwxrwt 4 root root 4096 Oct 31 17:21 tmp
So, all that looks good. So there must be something in the handoff between Nginx and rails app, that the rails app can not read the file. My app is running as the ‘deploy’ user.
Any ideas would be appreciated.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
The error is referencing ImageMagick’s identify command. Either imagemagick is not installed, or the path to the command is not specified in your CarrierWave initializer.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.