macportsでsshfsをインストールしようとしたら、突然出来なくなった。
のでそんな時の対処法。
参考URL
#54939 (osxfuse @3.7.1: Library not loaded: @rpath/libclang.dylib (LoadError)) – MacPorts https://trac.macports.org/ticket/54939#no1
エラー
osxfuseがあんなことやこんなことでbuild出来ないと言われる。
terminal
$ sudo port install sshfs
Password:
---> Computing dependencies for sshfs
The following dependencies will be installed: osxfuse
Continue? [Y/n]: Y
---> Fetching archive for osxfuse
---> Attempting to fetch osxfuse-3.7.1_0.darwin_17.x86_64.tbz2 from https://packages.macports.org/osxfuse
---> Attempting to fetch osxfuse-3.7.1_0.darwin_17.x86_64.tbz2 from http://fco.it.packages.macports.org/mirrors/macports-packages/osxfuse
---> Attempting to fetch osxfuse-3.7.1_0.darwin_17.x86_64.tbz2 from http://jnb.za.packages.macports.org/packages/osxfuse
---> Fetching distfiles for osxfuse
---> Verifying checksums for osxfuse
---> Extracting osxfuse
---> Configuring osxfuse
---> Building osxfuse
Error: Failed to build osxfuse: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_www.macports.org_files_ports_fuse_osxfuse/osxfuse/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port sshfs failed
ログを見ろと出るのでログを見ると
/opt/local/var/macports/logs/_opt_local_var_macports_sources_www.macports.org_files_ports_fuse_osxfuse/osxfuse/main.log
:info:build /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': dlopen(/System/Library/BridgeSupport/ruby-2.3/bridgesupportparser.bundle, 9): Library not loaded: @rpath/libclang.dylib (LoadError)
:info:build Referenced from: /System/Library/BridgeSupport/ruby-2.3/bridgesupportparser.bundle
:info:build Reason: image not found - /System/Library/BridgeSupport/ruby-2.3/bridgesupportparser.bundle
端的に言えばHighSierraではそのままだと無理のよう。
対処法
1.xcodeのtoolchainを変更する
defaultのtoolchainsに、High Sierra(OSX10.13)のtoolchainをリンクする。
terminal
$ cd /Applications/Xcode.app/Contents/Developer/Toolchains
$ sudo ln -s XcodeDefault.xctoolchain OSX10.13.xctoolchain
2.sshfsをインストール
sshfsを通常コマンドでインストールする。
terminal
$ sudo port install sshfs
---> Computing dependencies for sshfs
The following dependencies will be installed: osxfuse
Continue? [Y/n]: Y
---> Building osxfuse
---> Staging osxfuse into destroot
Warning: osxfuse installs files outside the common directory structure.
---> Installing osxfuse @3.7.1_0
---> Activating osxfuse @3.7.1_0
---> Cleaning osxfuse
---> Fetching archive for sshfs
---> Attempting to fetch sshfs-2.10_0.darwin_17.x86_64.tbz2 from https://packages.macports.org/sshfs
---> Attempting to fetch sshfs-2.10_0.darwin_17.x86_64.tbz2 from http://fco.it.packages.macports.org/mirrors/macports-packages/sshfs
---> Attempting to fetch sshfs-2.10_0.darwin_17.x86_64.tbz2 from http://jnb.za.packages.macports.org/packages/sshfs
---> Fetching distfiles for sshfs
---> Attempting to fetch sshfs-2.10.tar.gz from https://github.com/libfuse/sshfs/tarball/sshfs-2.10
---> Verifying checksums for sshfs
---> Extracting sshfs
---> Applying patches to sshfs
---> Configuring sshfs
---> Building sshfs
---> Staging sshfs into destroot
---> Installing sshfs @2.10_0
---> Activating sshfs @2.10_0
---> Cleaning sshfs
---> Updating database of binaries
---> Scanning binaries for linking errors
---> No broken files found.
---> Some of the ports you installed have notes:
osxfuse has the following notes:
When upgrading, unmount all FUSE filesystems and then unload the kernel extension.
Unloading can be done via: sudo kextunload -b com.github.osxfuse.filesystems.osxfuse
Alternatively (or if this fails), just reboot your computer now.
とりあえずこれで動くようにはなったのだが、toolchainsを換えているので、何か変なこと起こったりしないんだろうかと思ったり、思わなかったり。
terminal
$ sshfs
missing host
see `sshfs -h' for usage