web-dev-qa-db-ja.com

Homebrewのreadlineバージョン6.xに戻ってPostgresqlを修正しますか?

私はHomebrewの専門家ではありませんが、 9/15/16 :の後にreadlineバージョン6.xから7.0に「アップグレード」されたと思います。

eat@eric-macbook:Homebrew$ brew info readline
readline: stable 7.0 (bottled) [keg-only]
Library for command-line editing
https://tiswww.case.edu/php/chet/readline/rltop.html
/usr/local/Cellar/readline/7.0 (45 files, 2M)

これにより、Postgresqlの9.4.5 Homebrewバージョンで頭痛の種になりました(比較のため、古い9.4が必要です)。

eat@eric-macbook:~$ psql --version
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib
  Referenced from: /usr/local/Cellar/postgresql/9.4.5/bin/psql
  Reason: image not found
Trace/BPT trap: 5

残念ながら、Homebrewに戻るには6.xバージョンのreadlineが見つかりません-7.0しか利用できないようです(?)。

私の質問は2つあります。

  • Readlineのバージョンがpostgres/psqlの問題の原因と一致していませんか?
  • その場合、Homebrewで6.xに戻って問題を修正するにはどうすればよいですか?

前もって感謝します!

50
ericky

特定の質問に答えるため。

この質問で説明されているように、ローカルにあるインストール済みのbrewパッケージのバージョンを切り替えることができます: Homebrew install特定バージョンの式?

Readline 6.xにダウングレードするために、次のコマンドが機能しました。

brew switch readline 6.3.8
61
DanEEStar

再インストールpostgresql94パッケージ、PostgreSQL 9.4は新しいreadlineパッケージを使用します。

brew reinstall postgresql94
27
vitalie

注:この答えはブランチの変更のために時代遅れかもしれません(Andrewによって報告されたように、コミットは消えます)

まだこの問題に直面しているが、homebrewパッケージからreadline 6.3.8をダウンロードできない人に。この解決策を試すことができます。 ( こちら から参照)

# Uninstall this incompatible version
brew uninstall readline

# Go to the local clone of homebrew-core
cd $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core

# Move to the homebrew-core revision that had 6.3.8
git checkout 35fed817726f61a9d40c8420582f6fde59eb5f14

# Re-install readline
brew reinstall readline

# Switch back to HEAD
git checkout master

# Pin readline so this can't happen again
brew pin readline
25
Sam Kah Chiin

Railsからこの問題が発生している場合は、readline gemを追加してbundle install

gem 'rb-readline' #Fixed readline error
3
bkunzi01

毛布でこれを克服することができましたbrew upgrade(すべてのbrew管理パッケージをアップグレードします)。

1
Seth Bro

Sam Kah Chiinのソリューションを使用する場合は、404を無視できます。

新しいmacOSで動作するように追加の変更を適用します。

diff --git a/Formula/readline.rb b/Formula/readline.rb
index 08d3728..d67e5e4 100644
--- a/Formula/readline.rb
+++ b/Formula/readline.rb
@@ -16,7 +16,7 @@ class Readline < Formula
     sha256 "c129333634dd00ab2267ae9c531fca1f5cc50dd519ed3399918289fdfdf2663b" => :lion
   end

-  keg_only :shadowed_by_osx, <<-EOS.undent
+  keg_only :shadowed_by_macos, <<~EOS
     OS X provides the BSD libedit library, which shadows libreadline.
     In order to prevent conflicts when programs look for libreadline we are
     defaulting this GNU Readline installation to keg-only.

行う Sudo update_dyld_shared_cache 最後に

0
user2679290