Rails 3:Errno :: ENOENT异常

时间:2014-01-03 14:30:03

标签: ruby-on-rails upload path temporary-files fileutils

我的代码如下。它在我的本地计算机上运行正常

`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`

但是在我的远程服务器上,这是一个CentOS服务器,它给了我这个

`Errno::ENOENT in CustomController#process_custom_order

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

谢谢,伙计们!

0 个答案:

没有答案