Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个有很多文件操作的项目。我正在尝试 Rubinius,因为我需要能够编译代码。当我尝试运行包含
if Dir.exist?(file_path)
我收到此错误:
NoMethodError: undefined method `exist?' on Dir (Class)
有什么我需要包括的东西才能得到认可吗?顺便说一句,我也尝试过 Dir.exists?因为它是一个别名,这也不起作用。这个方法在 1.8.7 中不存在的问题吗?我似乎找不到列表
问题是 Rubinius 使用的是 1.8.7,而这种方法当时并不存在。