开发者

ruby fusefs-osx gem can't mount correctly

开发者 https://www.devze.com 2023-03-09 06:17 出处:网络
I installed the fusefs-osx 0.7.0 gem but the sample scripts don\'t mount. I tried hello.rb and yamlfs.rb. The script doesn\'t abort, and the mount point\'s Finder icon changes to a mounted disk, but I

I installed the fusefs-osx 0.7.0 gem but the sample scripts don't mount. I tried hello.rb and 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. If I try "ls", I get "Input/output error".

Running lsof on the ruby process shows that the gem's fusefs_lib.bundle and /opt/local/lib/libfuse_ino64.2.dylib are loaded. "/dev/fuse0" is also in the list.

lsof also gives this error:

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):

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.

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.

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. Basically, I edited the extconf.rb like so:

$ 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. This isn't actually needed, since the gem always loads from the ext dir.

I think I read somewhere that Snow Leopard requires the ino64 version.

0

精彩评论

暂无评论...
验证码 换一张
取 消