0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

emacs, nyleのinstallで死んだ件

Last updated at Posted at 2020-06-08

gem install nyleで少し悩んだ

nyleってdrawing gemsがあって,良さそうなんで入れてみたんですが,
emacsからエラーが出て...

gem install nyle直後のemacsのエラー

> emacs --version 
dyld: Library not loaded: /usr/local/opt/libffi/lib/libffi.6.dylib
  Referenced from: /usr/local/opt/p11-kit/lib/libp11-kit.0.dylib
  Reason: image not found
fish: 'emacs --version' terminated by signal SIGABRT (Abort)

> brew upgrade emacs
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
maxima

これでemacsは動く.

brew upgrade emacs直後

今度は,nyleでエラー

> ruby image_rotate.rb
dlopen(/Users/bob/.rbenv/gems/2.6.0/gems/gobject-introspection-3.4.3/lib/gobject_introspection.bundle, 9): Library not loaded: /usr/local/opt/libffi/lib/libffi.6.dylib (LoadError)
  Referenced from: /usr/local/opt/gobject-introspection/lib/libgirepository-1.0.1.dylib
  Reason: image not found - /Users/bob/.rbenv/gems/2.6.0/gems/gobject-introspection-3.4.3/lib/gobject_introspection.bundle

libffi.6.dylibを探して入れる

特定のminor versionをbrewで入れる方法を探ったがどこへ入れるか難しそう.
「brewってrubyで管理しているgithubじゃん」ってのを思い出してFileUtilsでcpするのと同じという狙いで,

> brew list libffi  
/usr/local/Cellar/libffi/3.3/include/ (2 files)
/usr/local/Cellar/libffi/3.3/lib/libffi.7.dylib
/usr/local/Cellar/libffi/3.3/lib/pkgconfig/libffi.pc
/usr/local/Cellar/libffi/3.3/lib/ (3 other files)
/usr/local/Cellar/libffi/3.3/share/info/libffi.info
/usr/local/Cellar/libffi/3.3/share/man/ (4 files)

で探してみると,/usr/local/Cellar/libffiに3.2.1があったので,
その中身を見ると

> ls -lat /usr/local/cellar/libffi/3.2.1/lib
total 128
drwxr-xr-x  9 bob  staff    288 11  1  2018 ../
drwxr-xr-x  3 bob  staff     96 11  1  2018 pkgconfig/
-r--r--r--  1 bob  staff  28844 11  1  2018 libffi.6.dylib
drwxr-xr-x  7 bob  staff    224 11 12  2014 ./
drwxr-xr-x  3 bob  staff     96 11 12  2014 libffi-3.2.1/
-r--r--r--  1 bob  staff  31880 11 12  2014 libffi.a
lrwxr-xr-x  1 bob  staff     14 11 12  2014 libffi.dylib@ -> libffi.6.dylib

なんで,こいつをnyleのライブラリが参照しているサイト(/usr/local/opt/libffi/lib)に置いた.
nyleを入れ直したら,素直に読んでくれるか持って思ってたんですが...

libssl.1.0.0.dylibも

おやおやこれもみたい.これはweb系のgemで出てきたエラー.

dlopen(/usr/local/Cellar/ruby/2.5.2/lib/ruby/2.5.0/x86_64-darwin17/digest/md5.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/Cellar/ruby/2.5.2/lib/ruby/2.5.0/x86_64-darwin17/digest/md5.bundle
  Reason: image not found - /usr/local/Cellar/ruby/2.5.2/lib/ruby/2.5.0/x86_64-darwin17/digest/md5.bundle (LoadError)

ってさ.brewのせいだね.

> brew list openssl
/usr/local/Cellar/openssl@1.1/1.1.1g/.bottle/etc/ (7 files)
/usr/local/Cellar/openssl@1.1/1.1.1g/bin/c_rehash

であたりをつけて

> ln -s /usr/local/Cellar/openssl/1.0.2r/lib/libssl.1.0.0.dylib /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
> ln -s /usr/local/Cellar/openssl/1.0.2r/lib/libcrypto.1.0.0.dylib /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib

で解決.やれやれ.

ボツにした危険なやり方

> cd /usr/local/opt/libffi/lib
> ls -lat
-r--r--r--   1 bob  staff  34180  6  8 14:24 libffi.7.dylib
-r--r--r--   1 bob  staff  38912 11 24  2019 libffi.a
lrwxr-xr-x   1 bob  staff     14 11 24  2019 libffi.dylib@ -> libffi.7.dylib

ln -s libffi.7.dylib libffi.6.dylib

ってとっても危険だけど,動いた.

libffi.6.dylibを入れたいんですが,やり方がわからなくって,brew install libffi@6とかやると壊れそうで,怖くて.
「ってsymbolic linkの方がもっと怖いやん」ということで,改善策を実行.

これから

問題が起こるかもってのの備忘録.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?