【问题标题】:Getting Ruby to chdir to remote server on Windows让 Ruby 到 chdir 到 Windows 上的远程服务器
【发布时间】:2012-09-06 14:38:19
【问题描述】:

我无法将目录更改为“\10.10.10.10\D$\some_dir”

FileUtils.chdir("\\\\10.10.10.10\\D$\\some_dir\\")

Dir.chdir("\\\\10.10.10.10\\D$\\some_dir\\")

不要在 Ruby 1.9.3 中工作!它在 Ruby 1.8.7 中工作

任何想法如何将目录更改为远程框目录?

【问题讨论】:

  • 你怎么知道它不起作用?为我工作。当您关注puts Dir.pwd 时会发生什么?

标签: ruby windows directory chdir


【解决方案1】:

好的,这是 Windows 中的一个问题,它无法访问远程盒子上的指定文件夹,因为没有指定用于访问该文件夹的凭据,我所做的就是去 win explorer 并在地址行中输入该文件夹的路径远程框“\10.10.10.10\D$\some_dir”上的文件夹 - 之后会提示凭据,只需输入它们并在您通过资源管理器访问文件夹后输入“记住凭据”脚本运行正常

【讨论】:

    猜你喜欢
    • 2012-03-31
    • 2010-11-23
    • 2017-05-06
    • 2011-06-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多