加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-1.9.2 – 未定义的方法`copy’for File:Class

发布时间:2020-12-16 21:58:00 所属栏目:百科 来源:网络整理
导读:我刚刚将一个项目升级到 Ruby 1.9.2,并且以下行使用’undefined method`copy’为File:Class’ File.copy(animage.image.path(:export),destfile) 我在此模块中加载了以下库 require 'zip/zipfilesystem'require 'iconv'require 'net/ftp'require 'fileutils
我刚刚将一个项目升级到 Ruby 1.9.2,并且以下行使用’undefined method`copy’为File:Class’
File.copy(animage.image.path(:export),destfile)

我在此模块中加载了以下库

require 'zip/zipfilesystem'
require 'iconv'
require 'net/ftp'
require 'fileutils'

解决方法

它实际上应该是FileUtils.copy或FileUtils.cp.我不知道你的旧项目如何使用File.copy,因为File没有这种方法.

请参考:http://santoro.tk/mirror/ruby-core/classes/FileUtils.html#M004325

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读