エラーの園

仕事、日常のあらゆるエラーと戦い、先人の知恵も拝借して何としても解決……したい!

The bundle currently has listen locked at [listenのバージョン]

エラー発生前の操作や設定など

bundle install した。

エラー内容

You have requested:  
  listen >= 3.0.5, < 3.2  
  
The bundle currently has listen locked at 3.2.1.  
Try running `bundle update listen`  
  
If you are updating multiple gems in your Gemfile at once,  
try passing them all to `bundle update`  

参考サイト

bundle install と bundle updateの違いについて

ありがとうございます!bundleのこと、しっかり理解できました。
簡潔で分かりやすかったです☺️

原因

Gemfileで設定したバージョンより、カレントのlistenのバージョンが新しかった。

作業環境

$ sw_vers  
ProductName:    Mac OS X  
ProductVersion: 10.15.4  
ruby 2.6.2p47  
Rails 6.0.3  

Gemfileの内容(抜粋)

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

解決手順

カレントのlisten3.2.1.だから、Gemの記述に合わせるために
bundleをupdateする。

1.bundle update

$ bundle update  
Fetching gem metadata from https://rubygems.org/............  
Fetching gem metadata from https://rubygems.org/.  
...(省略)...  
Bundle updated!  
Gems in the group production were not updated.  

↓↓実行後のGemfile.lockは、こちら(抜粋)↓

...(省略)...  
listen (3.1.5)  
  rb-fsevent (~> 0.9, >= 0.9.4)  
  rb-inotify (~> 0.9, >= 0.9.7)  
  ruby_dep (~> 1.2)  
...(省略)...  

実録『dyld: Library not loaded:〜』その3 (ようやくPostgreSQLバージョンアップの瞬間)

エラー発生前の操作や設定など

『エラーの園』前回までのお話

brew upgradeのエラーを潰して、潰して、潰した🔨
実録『dyld: Library not loaded:〜』その2 (brew upgradeのエラーいろいろ) - エラーの園

参考サイト

1. 前にエラーになったときにお世話になったサイト

unot13.hatenablog.com   ↑
ありがとうございます! 参考になりました 😌
brew info めっちゃ、分かりやすいです!

エラー内容

エラー1

$ brew postgresql-upgrade-database
Error: No such file or directory @ rb_sysopen - /usr/local/var/postgres/PG_VERSION

エラー2

$ brew install postgresql
Updating Homebrew...
Warning: postgresql 12.2_1 is already installed and up-to-date
To reinstall 12.2_1, run `brew reinstall postgresql`

作業環境

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.4

PostgreSQL Version: 10 -> 12

解決手順

1. 'brew info postgresql' で、エラーが無いか確認する。

$ brew info postgresql
postgresql: stable 12.2 (bottled), HEAD
Object-relational database system
https://www.postgresql.org/
/usr/local/Cellar/postgresql/12.2_1 (3,218 files, 37.8MB) *
  Poured from bottle on 2020-05-07 at 15:35:44
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/postgresql.rb
==> Dependencies
Build: pkg-config ✔
Required: icu4c ✔, krb5 ✔, openssl@1.1 ✔, readline ✔

...(以下、省略)...

2.やれやれ、やっとだ。ではbrew postgresql-upgrade-database実行!

$ brew postgresql-upgrade-database
Error: No such file or directory @ rb_sysopen - /usr/local/var/postgres/PG_VERSION
2−1.(考察)エラー1のパスを確認してみた。



。。。すんません😢 確認したけど、ログ取り忘れた。
ls -ll /usr/local/var/postgres/を実行すると、
postgres.old以外何も無かった。
とりあえず、postgres.oldは、下記コマンドで削除した。
'rm -rf /usr/local/var/postgres/postgres.old' で削除した。

2−2.再度brew postgresql-upgrade-database実行。

またエラー1が出た。

2−3.(考察)推理してみる。

upgradeするとき、下記の様に旧バージョンはバックアップ取っているから、
旧バージョンが必要かも。。。。/usr/local/var/postgresは空だからupgradeできない。

$ ls -ll /usr/local/var/
total 0
drwxr-xr-x   3 [user_name]  admin   96  5  7 12:43 bac
drwxr-xr-x   4 [user_name]  admin  128 12 23  2017 homebrew
drwxr-xr-x  13 [user_name]  admin  416  7  6  2019 log
drwxr-xr-x  27 [user_name]  admin  864  2 11 12:32 mysql
drwx------  26 [user_name]  admin  832  5 11 09:42 postgres
drwx------  24 [user_name]  admin  768  6 23  2019 postgresql@10
drwx------  24 [user_name]  admin  768  5  7 12:53 postgresql@11

そういえば、エラーで「見つけられない」と怒っていたファイルは、
/usr/local/var/postgres/PG_VERSIONだ。

【結論】
空っぽなら「installしよう!」と考えた。

※今、考えたら/usr/local/var/postgresを削除して、
/usr/local/var/postgres@11をに名称変更→
brew postgresql-upgrade-databaseでも良かった。
すべての経験は人生の糧になる🤨よし、次行ってみよー!

3.brew install postgresql実行

$ brew install postgresql
Updating Homebrew...
Warning: postgresql 12.2_1 is already installed and up-to-date
To reinstall 12.2_1, run `brew reinstall postgresql`

。。。すでにあるって知ってるんやね😓 なるほど、reinstallか。

3.brew reinstall postgresql実行

$ brew reinstall postgresql
==> Reinstalling postgresql
==> Downloading https://homebrew.bintray.com/bottles/postgresql-12.2_1.catalina.bottle.tar.gz
Already downloaded: /Users/naitoukazue/Library/Caches/Homebrew/downloads/c5a9a562b61627e48d66f4f76faa6ea1e0dbecddebf27c7825592722ca6364c8--postgresql-12.2_1.catalina.bottle.tar.gz
==> Pouring postgresql-12.2_1.catalina.bottle.tar.gz
==> /usr/local/Cellar/postgresql/12.2_1/bin/initdb --locale=C -E UTF-8 /usr/local/var/postgres
...(中略)...
==> Summary
🍺  /usr/local/Cellar/postgresql/12.2_1: 3,218 files, 37.8MB

終わった😑
おっと、確認、確認。

4.確認

4−1.バージョン確認。
$ psql --version
psql (PostgreSQL) 12.2

OK!

4−2.起動確認

環境変数を設定しているのでパスは省略して実行。  (環境変数の設定は上記参考サイトを参照ください)

$ pg_ctl start
waiting for server to start....2020-05-07 19:43:22.466 JST [19213] LOG:  starting PostgreSQL 12.2 on x86_64-apple-darwin19.4.0, compiled by Apple clang version 11.0.3 (clang-1103.0.32.59), 64-bit
2020-05-07 19:43:22.467 JST [19213] LOG:  listening on IPv6 address "::1", port 5432
2020-05-07 19:43:22.467 JST [19213] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2020-05-07 19:43:22.470 JST [19213] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-05-07 19:43:22.492 JST [19214] LOG:  database system was shut down at 2020-05-07 19:43:17 JST
2020-05-07 19:43:22.499 JST [19213] LOG:  database system is ready to accept connections
 done
server started

OKでございます👍

f:id:kuroneko-r011117:20200511155021j:plain

実録『dyld: Library not loaded:〜』その2 (brew upgradeのエラーいろいろ)

エラー発生前の操作や設定など

『エラーの園』前回までのお話

PostgresSQLのコマンドでエラーが出たので、
↓参考サイトをつまみ食いしながらエラーを解決しようと奮闘。↓
実録『dyld: Library not loaded:〜』その1 (Error: /usr/local/var/postgres.old already exists!ほか) - エラーの園

Homebrewをしっかり理解できていなかった😔
dyld: Library not loaded:〜 - エラーの園の(仮)解決手順は、
後ほど書き直す。
実施したこと見直していると作業が雑なことに気がついた。

参考サイト

Brewの実行ログを実施したので、
特にない。

エラー内容

エラー1

Error: Could not remove node keg! Do so manually:
  sudo rm -rf /usr/local/Cellar/node/12.8.0

エラー2

Error: glassfish: An unsatisfied requirement failed this build.

作業環境

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.4

PostgreSQL Version: 10 -> 12

解決手順

1.brew upgrade実行。

$ brew upgrade
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 4 taps (heroku/brew, homebrew/core, homebrew/cask and homebrew/services).
==> New Formulae
duktape      guile@2      kamel        openfast     redo         vlmcsd
==> Updated Formulae
gradle ✔                   gsoap                      pueue

...(中略)...

==> Summary
🍺  /usr/local/Cellar/groovy/3.0.3: 101 files, 26.0MB, built in 22 seconds
Removing: /usr/local/Cellar/groovy/2.5.1... (90 files, 16.8MB)
Removing: /usr/local/Cellar/node/12.8.0... (4,649 files, 53.7MB)
Error: Could not remove node keg! Do so manually:
  sudo rm -rf /usr/local/Cellar/node/12.8.0

2.エラー1の解消

2−1.Brewに指示された通りに実行する前に、とりあえず確認。
$ ls -l /usr/local/Cellar/node
total 0
drwxr-xr-x   7 [user_name]  staff  224  5  7 15:45 12.8.0
drwxr-xr-x  14 [user_name]  staff  448  5  7 15:43 14.1.0
2−2.(考察)なるほど。。。バージョン違いで2個ある。

古い方が邪魔な訳か。Groovy消してくれたのに。。。

$ sudo rm -rf /usr/local/Cellar/node/12.8.0
$
$ ls -l /usr/local/Cellar/node
total 0
drwxr-xr-x  14 [user_name]  staff  448  5  7 15:43 14.1.0
2−3.再度、brew upgrade実行!
$ brew upgrade
Updating Homebrew...
==> Upgrading 5 outdated packages:
pyenv 1.2.11 -> 1.2.18
ant 1.10.5 -> 1.10.7_1
glassfish 5.0 -> 5.1.0

...(中略)...

🍺  /usr/local/Cellar/ant/1.10.7_1: 1,670 files, 41.9MB, built in 57 seconds
Removing: /usr/local/Cellar/ant/1.10.5... (1,653 files, 39.3MB)
glassfish: Java 1.8 is required to install this formula.
Install AdoptOpenJDK 8 with Homebrew Cask:
  brew cask install homebrew/cask-versions/adoptopenjdk8
Error: glassfish: An unsatisfied requirement failed this build.

...(以降、省略)...

3.エラー2の解消

3−1.(考察) glassfish
$ ls -ll /usr/local/Cellar/glassfish
total 0
drwxr-xr-x  7 [user_name]  admin  224  1 19  2019 5.0

1 19 2019?2019年1月。。。。忌々しい過去が蘇ってきた😤
お客さんは、すごくいい人たちだったのに…
間に入っている奴が、圧圧圧。。。最近の技術に疎い井の中の蛙さん🐸
圧力かける事だけがお仕事。ケロ、ケーロ。

3−2.即抹殺!
$ brew uninstall glassfish
Uninstalling /usr/local/Cellar/glassfish/5.0... (1,021 files, 136.7MB)
[追記]:

glassfish 今回の件に全く関係ないことに気がついた。。。単なる感情論。
だけど、スッキリしたー😆

。。。brew upgradeだけで終わってしまった。
長くなったので、その3につづく。私には持久力がない😓
恨みは永遠に忘れないのだが😈。。。

f:id:kuroneko-r011117:20200509001832j:plain

実録『dyld: Library not loaded:〜』その1 (Error: /usr/local/var/postgres.old already exists!ほか)

エラー発生前の操作や設定など

『エラーの園』昨日までのお話

昔出したエラーを元に記事を書こうと、psql --version
実行したらエラーになった。
別の(正確には誤った順番で)操作をしたばかりに (dyld: Library not loaded:〜)https://blog.hatena.ne.jp/kuroneko-r011117/error-garden.hateblo.jp/edit?entry=26006613563320295を(仮)解決手順としなければならなかった。

真実その1

そこで、バージョンが古いと思い、参考サイト1. を参考に
brew postgresql-upgrade-database を実行した。
※同サイトには親切に注意書きとして、今回のエラーも記載されていた。
 感謝😌

エラー内容

エラー1

Error: /usr/local/var/postgres.old already exists!
Remove it if you want to upgrade data automatically.

↓エラー1解決後に、再びエラーがこれ↓

エラー2

ver.10から11にupgradeする時は、ご機嫌さんに乾杯🍻までしたのに。。。

$ brew postgresql-upgrade-database
==> brew install postgresql@11
==> Installing dependencies for postgresql@11: icu4c
==> Installing postgresql@11 dependency: icu4c
==> Downloading https://homebrew.bintray.com/bottles/icu4c-66.1.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/f0/f01dbe4266d1180c1da01d973200ed897cfa8ec8bf5
######################################################################## 100.0%
==> Pouring icu4c-66.1.catalina.bottle.tar.gz

...(中略)...
==> Summary
🍺  /usr/local/Cellar/icu4c/66.1: 258 files, 70.4MB
==> Installing postgresql@11

おおー、ver11からver.12までupgrade一気にするのか! 見上げたものだ🤓

...(中略)...
To have launchd start postgresql@11 now and restart at login:
  brew services start postgresql@11
Or, if you don't want/need a background service you can just run:
  pg_ctl -D /usr/local/var/postgresql@11 start
==> Upgrading postgresql data from 11 to 12...
waiting for server to start....2020-05-07 12:53:21.116 JST [3621] LOG:  listening on IPv6 address "::1", port 5432
2020-05-07 12:53:21.116 JST [3621] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2020-05-07 12:53:21.120 JST [3621] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-05-07 12:53:21.143 JST [3622] LOG:  database system was shut down at 2019-08-12 02:13:58 JST
2020-05-07 12:53:21.157 JST [3621] LOG:  database system is ready to accept connections
 done
server started

あれあれ。。。息切れか?(↓下記、続き)

waiting for server to shut down....2020-05-07 12:53:21.378 JST [3621] LOG:  received fast shutdown request
2020-05-07 12:53:21.380 JST [3621] LOG:  aborting any active transactions
2020-05-07 12:53:21.382 JST [3621] LOG:  background worker "logical replication launcher" (PID 3628) exited with exit code 1
2020-05-07 12:53:21.382 JST [3623] LOG:  shutting down
2020-05-07 12:53:21.393 JST [3621] LOG:  database system is shut down
 done
server stopped
==> Moving postgresql data from /usr/local/var/postgres to /usr/local/var/postgres.old...
==> Creating database...
Error: Upgrading postgresql data from 11 to 12 failed!
==> Moving postgresql data back from /usr/local/var/postgres.old to /usr/local/var/postgres...
Error: Failure while executing; `/usr/local/Cellar/postgresql/12.2_1/bin/initdb --lc-collate=C --lc-ctype=C --lc-messages=C --lc-monetary=C --lc-numeric=C --lc-time=C -E\ UTF8 /usr/local/var/postgres` exited with 1.

また、エラーですか。。。😔
新鮮なエラー、あがったよー!
採れ採れ、ピチピチ、ふふ、ふふ、ふーん♪

参考サイト

1. upgradeに関する情報

qiita.com   ↑
ありがとうございます! 参考になりました 😊

2. brewのupdateとupgradeの違い

qiita.com ありがとうございます! なるほど🧐 ……これをすれば、PostgresSQLのupgrade不要?
しかし、今回、余計なこといろいろしたので、
真実の物語を続けようと思う。

原因

・Homebrewが古かった。
$ brew upgrade でHomebrewでインストールしたパッケージも
 upgradeする必要があった。(Homebrewもupdateしてくれるらしい。
参考サイト2参照。

作業環境

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.4

PostgreSQL Version: 10 -> 12

解決手順

【準備】

・DBのバックアップは、忘れずに取っておいてください。

エラー1の解決

1.URLを参考に、bacディレクトリを作成して移動。
$ mkdir /usr/local/var/bac
$ mv /usr/local/var/postgres.old /usr/local/var/bac

エラー2の解決

1.HomebrewとHomebrewでインストールしたパッケージをupdate。

$ brew upgrade

。。。dyld: Library not loaded:〜の真実2につづく。

f:id:kuroneko-r011117:20200509001832j:plain

dyld: Library not loaded:〜

エラー発生前の操作や設定など

昔出したエラーを元に記事を書こうと、psql --version を実行したらエラーになった。

エラー内容

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/Cellar/postgresql/11.4/lib/libpq.5.11.dylib
  Reason: image not found
Abort trap: 6

参考サイト

1. 前にエラーになったときにお世話になったサイト

unot13.hatenablog.com   ↑
ありがとうございます! 参考になりました 😌
brew info めっちゃ、分かりやすいです!

2. 新たなエラーでお世話になったサイト

qiita.com

原因

brewが古かった。

【補足】

PostgreSQLのバージョンアップを久しぶりにしたので、  
手順に戸惑って試行錯誤したので下記解決手順は実際に行っていないので、  
コマンド実行時のログは一部省略する。 
次回のupgradeで、実際に下記解決手順を実施して正確な手順+ログを更新する。  

(R02.05.11追記)  
実際に実施した手順を再検証したので、実施できないが修正しておく。   
まずい部分は、次回、upgrade時に修正する。

作業環境

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.4

PostgreSQL Version: 10 -> 12

(仮)解決手順

【準備】

・DBのバックアップは、忘れずに取っておいてください。

1. brewでインストールしたPosgreSQLの情報を確認する。

$ brew info postgresql
postgresql: stable 12.2 (bottled), HEAD
Object-relational database system
https://www.postgresql.org/
/usr/local/Cellar/postgresql/11.4 (3,188 files, 35.4MB) *
  Poured from bottle on 2019-07-21 at 11:28:38
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/postgresql.rb
==> Dependencies
Build: pkg-config ✘
Required: icu4c ✘, krb5 ✘, openssl@1.1 ✔, readline ✔

※↑Dependenciesのicu4ckrb5ビルドエラーになっている。

2. 1.「✘」のパッケージをそれぞれupgradeする。

(例) icu4c の場合

$ brew upgrade icu4c
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
code-server         ghc@8.8             openstackclient     xxh

...(以下、省略)...

3. 再度 'brew info postgresql' を 実行してエラーが無いか確認する。

$ brew info postgresql
postgresql: stable 12.2 (bottled), HEAD
Object-relational database system
https://www.postgresql.org/
/usr/local/Cellar/postgresql/12.2_1 (3,218 files, 37.8MB) *
  Poured from bottle on 2020-05-07 at 15:35:44
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/postgresql.rb
==> Dependencies
Build: pkg-config ✔
Required: icu4c ✔, krb5 ✔, openssl@1.1 ✔, readline ✔

...(以下、省略)...

pkg-config、ビルドOKでございます👍

4. brewPostgreSQLをupgradeする。

brew postgresql-upgrade-database

5. PostgreSQLのバージョンを確認する。

$ psql --version
psql (PostgreSQL) 12.2

6. PostgreSQLの起動確認

※詳しくは参考サイト1参照。

データベースの起動
$ brew services start postgresql
==> Successfully started `postgresql` (label: homebrew.mxcl.postgresql)

または、

pg_ctl -D /usr/local/var/postgres start

環境変数を設定している場合は、

$ pg_ctl start
waiting for server to start....2020-05-07 19:43:22.466 JST [19213] LOG:  starting PostgreSQL 12.2 on x86_64-apple-darwin19.4.0, compiled by Apple clang version 11.0.3 (clang-1103.0.32.59), 64-bit
2020-05-07 19:43:22.467 JST [19213] LOG:  listening on IPv6 address "::1", port 5432
2020-05-07 19:43:22.467 JST [19213] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2020-05-07 19:43:22.470 JST [19213] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2020-05-07 19:43:22.492 JST [19214] LOG:  database system was shut down at 2020-05-07 19:43:17 JST
2020-05-07 19:43:22.499 JST [19213] LOG:  database system is ready to accept connections
 done
server started
データベースの一覧を表示する。
$ psql -l
                                 List of databases
   Name    |    Owner    | Encoding | Collate | Ctype |      Access privileges      
-----------+-------------+----------+---------+-------+-----------------------------
 postgres  | [user_name] | UTF8     | C       | C     | 
 template0 | [user_name] | UTF8     | C       | C     | =c/[user_name]             +
           |             |          |         |       | naitoukazue=CTc/[user_name] 
 template1 | [user_name] | UTF8     | C       | C     | =c/[user_name]              +
           |             |          |         |       | [user_name]=CTc/[user_name] 
(3 rows)
(おまけ)データベースの停止
$ brew services stop postgresql
==> Successfully started `postgresql` (label: homebrew.mxcl.postgresql)

または、

pg_ctl -D /usr/local/var/postgres stop

環境変数を設定している場合は、

$ pg_ctl stop

バックアップ

令和2年5月8日の最初に投稿した(仮)解決手順1〜6書き直すため、
とりあえず、バックアップとして封印しておく。

1. brewでインストールしたPosgreSQLの情報を確認する。

$ brew info postgresql
postgresql: stable 12.2 (bottled), HEAD
Object-relational database system
https://www.postgresql.org/
/usr/local/Cellar/postgresql/11.4 (3,188 files, 35.4MB) *
  Poured from bottle on 2019-07-21 at 11:28:38
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/postgresql.rb
==> Dependencies
Build: pkg-config ✘
Required: icu4c ✘, krb5 ✘, openssl@1.1 ✔, readline ✔

※↑Dependenciesのicu4ckrb5ビルドエラーになっている。

2. brewをupgradeする。

$ brew upgrade
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 4 taps (heroku/brew, homebrew/core, homebrew/cask and homebrew/services).
==> New Formulae
duktape      guile@2      kamel        openfast     redo         vlmcsd
==> Updated Formulae
gradle ✔                   gsoap                      pueue

...(以下、省略)...

3. 上記2. 実行時に何かと注意されるので、それを解決する。

(例)
Removing: /usr/local/Cellar/node/12.8.0... (4,649 files, 53.7MB)
Error: Could not remove node keg! Do so manually:
  sudo rm -rf /usr/local/Cellar/node/12.8.0

keg がよく分からないが、'/usr/local/Cellar/node/12.8.0を削除しろ!'
とのことなので、とりあえず、中身を確認してみる。

$ ls -l /usr/local/Cellar/node
total 0
drwxr-xr-x   7 [user_name]  staff  224  5  7 15:45 12.8.0
drwxr-xr-x  14 [user_name]  staff  448  5  7 15:43 14.1.0

なるほど。。。バージョン違いで2個ある。
古い方が邪魔な訳か。

$ sudo rm -rf /usr/local/Cellar/node/12.8.0
$
$ ls -l /usr/local/Cellar/node
total 0
drwxr-xr-x  14 [user_name]  staff  448  5  7 15:43 14.1.0

再度、実行!

$ brew upgrade

。。。と、こんな感じでErrorを潰していきます。

4. 3. の作業でエラーが無くなったら、再度 'brew info postgresql' を 実行してエラーが無いか確認する。

$ brew info postgresql
postgresql: stable 12.2 (bottled), HEAD
Object-relational database system
https://www.postgresql.org/
/usr/local/Cellar/postgresql/12.2_1 (3,218 files, 37.8MB) *
  Poured from bottle on 2020-05-07 at 15:35:44
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/postgresql.rb
==> Dependencies
Build: pkg-config ✔
Required: icu4c ✔, krb5 ✔, openssl@1.1 ✔, readline ✔

...(以下、省略)...

5. brewPostgreSQLをupgradeする。

`brew postgresql-upgrade-database'

【補足】

もし、brew upgradePostgreSQLがupgradeされていたら、
下記のエラーメッセージになるかも。(しっかりupgradeされています)

$ brew postgresql-upgrade-database
Error: postgresql data already upgraded!

grub rescue>

エラー発生前の操作や設定など

Lavie_LL550/Vの電源入れたら、エラーが表示。
このPC、インフラの練習用に好き放題して最終的には
CentOS7をインストールしたところまでは覚えているが、
その後、何をしたのか記憶がない。アンインストールしたかも。
このPCの経緯はを下記「おまけ」参照。

エラー内容

error: no such partition.
grub rescue>

参考サイト

原因究明

www.linuxandubuntu.com

  ↑
ありがとうございます! 救われました 😌

上記サイト、英語サイトでデインジャラスなお誘いがいくつかあるので  
強い意思で 「No Thanks!」 とか「×」してくださいね。  

www.partitionwizard.jp

  ↑
ここにもエラーに関する詳しい説明ありました😊

解決策

上記「原因究明」の一つ目のURLに解決方法の一つとして
「Live USBを作成せよ」とあったので、
下記URLにたどり着いた。 blog.mktia.com

  ↑
すごくわかりやすかったです!感謝!! Lavie蘇りました😊

原因

前回、今一つ何をして、このPCをシャットダウンしたのか覚えていないので、
原因不明。
おぼろげに覚えているのは、何かの理由でCentOSをアンインストールしたかも。。。
とりあえず、このPCにはOSが入っていなかった気がする。
随分、長い間放置していたものだ。
昨日の夜ご飯のメニューも覚えていないのに、こんな前のこと覚えてない😑

解決手順

作業環境

Windows 10
(↑2代目 Lavie。現在の事務作業用PC)
USBメモリ 32GB
(↑こんなにも必要ないです。4GBあれば充分とのこと)
(↑↑(余談)Amazonで買ったエレコムUSBメモリ、猫っぽい顔しててキュート😺
  2000円弱で32GBも手に入る。。。幸せな時代だ。)

UbuntuのLive USB作成

下記URL通り作業する。
blog.mktia.com


以下は上記URLで紹介されていたURLやアプリ

Ubuntu 14.04 LTS(i386版の追記あり)
※ 32ビットに対応しているのが、Ubuntu 14.04までだそうです。
Ubuntu 14.04 LTS 日本語 Remix リリース
filehippo.com

■「Universal USB Installer」
フラッシュメモリにisoを焼いてInstallerを作成してくれるアプリ
filehippo.com

【注意!】
外国のアプリだから、サイトの勧誘が結構強引。
要注意は「ダウンロード」ボタン押下後に表示されるポップアップ画面の
「ダウンロード」ボタン。
これはUniversal USB Installerとは全く関係のないアプリのダウンロードボタンで、
「Universal USB Installer」は裏でダウンロードの準備をしているので、
ファイルを保存するためのポップアップが開くまで何もせず我慢☹️して待つ。

Lavieの対応

economy-mode.hatenablog.com

頑張ってUbuntuのMenu画面を写経してみた。

Ubuntu Menu画面
Try ubuntu without installing
Install Ubuntu
Check disc for defects
Test memory
Boot from first hard disk
Advanced options
Help

↓【上記Menuの翻訳】↓

インストールせずにubuntuを試す
Ubuntuをインストールする
ディスクに欠陥がないか確認する
テストメモリ
最初のハードディスクから起動
高度なオプション
ヘルプ

おまけ

Lavieと私

6年前、新しいPCの買い替えと同時にインフラ練習マシーンに役割を変更した。 Linuxの知識が無いばかりに、現場で散々バカにされて、
どうすれば知識を得ることができるのか調査すると
当時、「素人からでも大丈夫なLinux講座」(正式な名前は覚えていない)と
称して3、4日のセミナーで 「10万円」 という法外な値段を吹っかける講座があった。
薄給だった私は、「書籍やWebでも情報は得られる!」と信じ、あとはマシーンだけ。
丁度、 売りに出そうとしていたこのLavieに目を付けた。
と、言うのもこのLavie見積もりに出した時期が遅すぎたのかもしれないが、
PCショップの回答が 「1500円」 。。。マジか😨。。。10万以上はしたのに。。。
減価償却しても 「1500円」 は酷だろ。。。Lavieに失礼だ。
私は考えた。薄給でお金に飢えていた私は真剣に考えた。。。
「本はある」
「Webの情報も集めている」
「10万円セミナーの宣伝用Linuxマニュアルもある」
そして、壊しても大丈夫なPCがある!
「1500円」が「10万円」の価値になる!!


そんな訳で、 恐れ要らずのマシーンと、素人らしく堂々と体当たりした。
元々、Windows XPが入っていたのを、削除してLinux mintに入れ替えた。
。。。削除というより、パーティション切ろうとして失敗したというのが正しい。
素人ゆえの過ち ……か
(何だか懐かしい。赤いLavieだし、お似合いだ。。。赤い彗星Lavie。It's Cool😎)。
その後、何年も放置した挙句Linux mintのアカウントを忘れて、四苦八苦してCentOSを入れ直した。
さらに、その後、また放置して何をしたのか覚えていない。

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.xx.dylib

エラー発生前の操作や設定など

rails g scaffold ...(以下省略) した時に発生したエラー。

エラー内容

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.xx.dylib

※xxはバージョン

参考サイト

qiita.com
  ↑
ありがとうございます! 救われました 😌

原因

↓上記サイトからの引用です。↓

調べてみると、macOSでは、libicucore.dylib というライブラリが提供されていて、 icu4cをインストールする必要がなくなっている。

しかし、nodeをインストールする時に、icu4cを含めてインストールしたため、 libicucore.dylib と icu4c が相互干渉してしまい、エラーが出た模様。

解決手順

brew reinstall node を実行する。

$ brew reinstall node
==> Reinstalling node 
==> Downloading https://homebrew.bintray.com/bottles/node-12.8.0.mojave.bottle.t
==> Downloading from https://akamai.bintray.com/f0/f031e6449005c545aaee4cb752895
######################################################################## 100.0%
==> Pouring node-12.8.0.mojave.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/node/12.8.0: 4,629 files, 53.1MB
Removing: /usr/local/Cellar/node/10.1.0... (5,301 files, 51.4MB)
naitoukzuenoAir:toy_app naitoukazue$ node -v
v12.8.0