简体   繁体   English

ruby fusefs-osx gem 无法正确安装

[英]ruby fusefs-osx gem can't mount correctly

I installed the fusefs-osx 0.7.0 gem but the sample scripts don't mount.我安装了 fusefs-osx 0.7.0 gem,但没有安装示例脚本。 I tried hello.rb and yamlfs.rb.我尝试了 hello.rb 和 yamlfs.rb。 The script doesn't abort, and the mount point's Finder icon changes to a mounted disk, but I can't access the contents.脚本没有中止,并且挂载点的 Finder 图标更改为已挂载的磁盘,但我无法访问内容。 If I try "ls", I get "Input/output error".如果我尝试“ls”,我会得到“输入/输出错误”。

Running lsof on the ruby process shows that the gem's fusefs_lib.bundle and /opt/local/lib/libfuse_ino64.2.dylib are loaded.在 ruby 进程上运行 lsof 显示 gem 的 fusefs_lib.bundle 和 /opt/local/lib/libfuse_ino64.2.dylib 已加载。 "/dev/fuse0" is also in the list. “/dev/fuse0”也在列表中。

lsof also gives this error: lsof 也给出了这个错误:

lsof: WARNING: can't stat() fusefs file system /fusefs/rb_hello
      Output information may be incomplete.
      assuming "dev=2d00000b" from mount table

The "mount" command shows (username elided): “mount”命令显示(用户名省略):

ruby@fuse0 on /fusefs/rb_hello (fusefs, nodev, nosuid, synchronous, mounted by ...)

When I ctrl-C the script, I have to umount the point manually.当我 ctrl-C 脚本时,我必须手动卸载该点。

System info:系统信息:

Leopard 10.5.8
ruby enterprise 1.8.7-2011.03 (i386 only)
libfuse 2.7.3 installed via Macports

I also tried installing the gem on the system ruby but I get the same result.我还尝试在系统 ruby 上安装 gem,但我得到了相同的结果。

Google didn't turn up any results about this issue.谷歌没有找到关于这个问题的任何结果。

Well, after poking around in the gem's ext directory, and looking at the lsof output of a fuse-python script, I found a workaround.好吧,在 gem 的 ext 目录中四处寻找,并查看了 fuse-python 脚本的 lsof output 之后,我找到了一种解决方法。 Basically, I edited the extconf.rb like so:基本上,我像这样编辑了 extconf.rb:

$ diff extconf.rb.orig extconf.rb $ diff extconf.rb.orig extconf.rb

3c3
< if have_library('fuse_ino64') || have_library('fuse') 
---
> if have_library('fuse') 

Then run:然后运行:

make clean
ruby extconf.rb
make

Then copy the fusefs_lib.bundle to the lib dir.然后将 fusefs_lib.bundle 复制到 lib 目录。 This isn't actually needed, since the gem always loads from the ext dir.这实际上不是必需的,因为 gem 总是从 ext 目录加载。

I think I read somewhere that Snow Leopard requires the ino64 version.我想我在某处读到雪豹需要 ino64 版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM