RubyとPostgreSQLとsinatraと(その壱)再起動せえ。

# PostgreSQLために

gem install pg

をしたいのに、エラー?

まずは、Homebrew を使って PostgreSQLをいれる。

qiita.com



brew update
brew install postgresql


ここで、エラー

gem install pg
/Users/myMBP/.rbenv/shims/gem: line 21: /usr/local/Cellar/rbenv/1.1.2/libexec/rbenv: No such file or directory


こっちも同じく。

sinatra % bundler install                   
/Users/myMBP/.rbenv/shims/bundler: line 21: /usr/local/Cellar/rbenv/1.1.2/libexec/rbenv: No such file or directory
sinatra % 

f:id:Barnum:20211019180137p:plain



エラー箇所に潜ってみる。


code /Users/myMBP/.rbenv/shims/gem
21: exec "/usr/local/Cellar/rbenv/1.1.2/libexec/rbenv" exec "$program" "$@"

おーおったわー

rbenv/1.1.2のバージョン違いっぽい

じゃあその参照先を確認っと、

f:id:Barnum:20211019180221p:plain



こいつに書き換える。


f:id:Barnum:20211019175934p:plain
edit


これで試す。


エラー。。。



これか?と思って試そうとするも、そもそもプロキシとか設定とかしてないし、理解浅いしで積んでました。


qiita.com


最終的に
再起動
という魔法で解決しました。


sinatra % gem install pg
Fetching pg-1.2.3.gem
Building native extensions. This could take a while...
Successfully installed pg-1.2.3
Parsing documentation for pg-1.2.3
Installing ri documentation for pg-1.2.3
Done installing documentation for pg after 1 seconds
1 gem installed


うーんこの・・・

納得はいかんが、次に進めるのでよしとする。
困ったら、再起動はほんとあるあるよなあ。