Rails 3. getting Errno::EACCES Permission Denied when uploading files on production

前端 未结 4 1708
忘了有多久
忘了有多久 2020-12-10 05:15

The app works fine in development but in production I get Errno::EACCES Permission Denied error when I try to upload a file using Carrierwave. I\'m sure it has something to

4条回答
  •  攒了一身酷
    2020-12-10 05:35

    Uhm I have been having the same issue with a ubuntu server. Uploading a file with carrierwave and then trying to read it with roo (a gem for excel files).

    Errno::EACCES in IngestionController#upload
    Permission denied
    

    Permissions have been chmod-ed to 777 on that directory and the file gets created ok. I believe the issues is when reading the store path.

    excelx_file = params[:excel_file]
    filex = MetadataUploader.new
    filex.store!(excelx_file)
    workbook = Excelx.new("#{filex.store_path}") <- This is the actual line throwing the error.
    

    Although everything works ok when executing the same app on my mac.

提交回复
热议问题