10 10月, 2022
開発でポート5000使ってるんだけどエラーがはて?
Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:5000 -> 0.0.0.0:0: listen tcp 0.0.0.0:5000: bind: address already in use
lsof -i:5000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ControlCe 85856 user10 26u IPv4 0x4ff853972c8bedd 0t0 TCP *:commplex-main (LISTEN)
ControlCe 85856 user10 27u IPv6 0x4ff85430b21e97d 0t0 TCP *:commplex-main (LISTEN)
なんじゃこやつは?
どうやらMontereyからAirPlay機能というのが追加されて乗っ取られたらしい
System Preference > Sharing > AirPlay Receiver > チェックをOff
これで使えるようになるけど。。。先々を考えると他の人も同じ問題に遭遇するだろうから開発側を変えるしかないかな
3 7月, 2022
macOS Monterey
Version12.4
■1.「SIP」をdisableに変更
(システム整合性保護(System Integrity Protection: SIP)の無効化)
Macを一度シャットダウン
起動時に「command + R」押下、マークが表示されたら離す
リカバリーモードが起動
上のメニューバーから「ターミナル起動」
# コマンド:「csrutil status」が「enabled」なら
csrutil status
# コマンド:「csrutil disable」を叩く(再起動しないと反映されない!)
csrutil disable
# コマンド:「reboot」にてMac再起動
reboot
■2.ターミナルをファイルフル権限に設定
通常起動後に
「システム環境設定」
↓
「セキュリティーとプライバシー」
↓
「プライバシー」タブの右側「フルアクセス」
↓
「ターミナル」のチェックボックスOn
■3.「.DS_store」を削除&作成不能とする
# .DS_Storeファイル全部削除
sudo find / -name ".DS_Store" -delete
# Finder再起動
Killall Finder
# .DS_Storeファイルを完全に作らない
defaults write com.apple.desktopservices DSDontWriteNetworkStores True
# Finder再起動
Killall Finder
■4.必要ないならiCloud同期しない設定がおすすめ
19 3月, 2022
覚書
#まずはbundle
bundle install --path vendor/bundle
#そしてプロジェクトのbundleを使う
bundle exec pod install
15 3月, 2022
古い環境が必要となり旧macへXcodeやRuby環境つくる時にハマったので覚書
20220315
■環境
macOS High Sierra 10.13.6
Homebrew 3.4.1-67-gb31d8e9
rbenv 1.2.0
こんなエラーが発生
Downloading openssl-1.1.1l.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
Installing openssl-1.1.1l...
BUILD FAILED (Mac OS X 10.13.6 using ruby-build 20220218)
Inspect or clean up the working tree at /var/folders/rc/9hwgt2nd0rxgjzvt9kc0zgph0000gn/T/ruby-build.20220315231102.889.ggie1q
Results logged to /var/folders/rc/9hwgt2nd0rxgjzvt9kc0zgph0000gn/T/ruby-build.20220315231102.889.log
Last 10 log lines:
/usr/include/CommonCrypto/CommonRandom.h:35:9: error: unknown type name 'CCCryptorStatus'
typedef CCCryptorStatus CCRNGStatus;
^
crypto/rand/rand_unix.c:385:47: error: use of undeclared identifier 'kCCSuccess'
if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess)
^
2 errors generated.
make[1]: *** [crypto/rand/rand_unix.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2
そこでOpenSSL1.0が必要
以下のコマンドにて「rbenv/tap/openssl@1.0 1.0.2t」がインストールされる
#OpenSSL1.0をInstall
brew install rbenv/tap/openssl@1.0
#環境変数設定 [hogeはuserだよ]
echo 'export PATH="/usr/local/opt/openssl@1.0/bin:$PATH"' >> /Users/hoge/.bash_profile
#環境変数反映
source .bash_profile
#必要なら環境変数反映
export LDFLAGS="-L/usr/local/opt/openssl@1.0/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.0/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.0/lib/pkgconfig"
#これその後のコマンド用に必要!
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl@1.0`"
#好きなRubyインストール
rbenv install 2.6.9
macOSの場合はOpenSSLの影響が他にもある
OpenSSLはRailsなどに使用するmysql2ライブラリーにも影響あり、MySQL5.6 Or 5.7使用する際にも影響あるので注意!
bundle installする前に
[.bundle/config]ファイルへ
以下、設定が必要!
BUNDLE_BUILD__MYSQL2: "--with-ldflags=-L/usr/local/opt/openssl@1.0/lib --with-cppflags=-I/usr/local/opt/openssl@1.0/include"