Rails 3: Errno::ENOENT exception

懵懂的女人 提交于 2019-12-12 04:42:35

问题


I have the code as following. It runs OK on my local machine

`params[:file].each do |f|
    tmp = f.tempfile
    ext = File.extname(f.original_filename)

    basic_file_name = "#{session[:user]["id"]}_#{Time.new.to_i}#{ext}".downcase

    file = File.join(TEMPORARY_FILE_FOLDER, basic_file_name)
    FileUtils.cp tmp.path, file`

But on my remote server which is a CentOS server, it gives me this

`Errno::ENOENT in CustomController#process_custom_order

No such file or directory - public/uploaded/709_1388758536.jpg`

Thanks, guys!

来源:https://stackoverflow.com/questions/20905869/rails-3-errnoenoent-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!