Rails 上的 Samba 共享

发布于 2024-09-17 23:43:30 字数 588 浏览 2 评论 0原文

我正在 Rails 中编写一个 XML 文件(在 RHEL 上运行),然后需要将此文件发布到 Windows 共享。

安装了 Sambala,以便我们可以通过 SMB 访问共享,但在运行一些测试代码后,我收到错误: 未初始化常量 ApplicationController::Sambala

samba = Sambala.new(  :domain   =>  'myDOMAIN',
                      :host     =>  'myHOST',
                      :share    =>  'mySHARE',
                      :user     =>  'myUSER',
                      :password =>  'myPASSWORD')

    samba.cd('mySHARE')   # =>  true
    samba.put(:from => 'aLocalFile.txt')

有没有更好的方法在 RHEL 上使用 Rails 连接到 Windows 共享?或者我是否需要在某处引用桑巴拉?

I am writing an XML file in rails(running on RHEL) and will then need to post this file across to a windows share.

Sambala was installed so that we can SMB to the share, but after running some test code I get the error:
uninitialized constant ApplicationController::Sambala

samba = Sambala.new(  :domain   =>  'myDOMAIN',
                      :host     =>  'myHOST',
                      :share    =>  'mySHARE',
                      :user     =>  'myUSER',
                      :password =>  'myPASSWORD')

    samba.cd('mySHARE')   # =>  true
    samba.put(:from => 'aLocalFile.txt')

Is there a better way to connect to a windows share using rails on RHEL? or do I need to include a reference to sambala somewhere?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

别理我 2024-09-24 23:43:30

使用 ` 键您可以发送操作系统命令。

`mount -t cifs //server/share -o username=USERNAME,password=PASSWORD /directoryToMount`

using the ` key you can send OS commands.

`mount -t cifs //server/share -o username=USERNAME,password=PASSWORD /directoryToMount`
年少掌心 2024-09-24 23:43:30

通常,您只需在操作系统级别安装 Windows 驱动器即可,无需使用如此直接的东西。如果您缺乏管理员权限,您应该能够使用 FUSE 来做您想做的事情。

You can usual just mount the Windows drive on the OS level, no need to use something so direct. If you lack admin privileges, you should be able to use FUSE to do what you want.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文