Return to readline version 6.x in Homebrew to fix Postgresql?

后端 未结 6 1094
孤独总比滥情好
孤独总比滥情好 2020-12-24 00:29

I\'m no Homebrew expert but I think it has \"upgraded\" me from readline version 6.x to 7.0 sometime after 9/15/16:

eat@eric-macbook:Homebrew$ brew info read         


        
相关标签:
6条回答
  • 2020-12-24 01:14

    For people coming from Rails with this issue you can just add the readline gem and run bundle install.

    gem 'rb-readline' #Fixed readline error
    
    0 讨论(0)
  • 2020-12-24 01:24

    To answer the specific question.

    You can switch between version of installed brew packages which are still around locally as explained in this question: Homebrew install specific version of formula?

    To downgrade to readline 6.x the following command worked for me:

    brew switch readline 6.3.8
    
    0 讨论(0)
  • 2020-12-24 01:29

    NOTE: This answer might be outdated due to the changes in the branch (as reported by Andrew, the commit disappear)

    To those who still facing this issue but cannot download the readline 6.3.8 from the homebrew package. You can try this solution. (Refer from here)

    # 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
    
    0 讨论(0)
  • 2020-12-24 01:29

    I was able to overcome this with a blanket brew upgrade (upgrade all brew-managed packages).

    0 讨论(0)
  • 2020-12-24 01:31

    Just reinstall postgresql94 package, the PostgreSQL 9.4 will use the new readline package:

    brew reinstall postgresql94
    
    0 讨论(0)
  • 2020-12-24 01:32

    If you would use Sam Kah Chiin's solution, you can ignore the 404.

    Apply the extra change so it would work on new 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.
    

    Do sudo update_dyld_shared_cache at the end

    0 讨论(0)
提交回复
热议问题