rails console doesn't load due to libreadline

前端 未结 10 605
心在旅途
心在旅途 2020-12-02 15:12

I have recently reinstalled ruby 2.1.2 like so since I wanted to install a gem (ruby-debug-ide)

sudo rvm reinstall 2.1.2 --disable-binary --with         


        
相关标签:
10条回答
  • 2020-12-02 15:34

    After getting a lot of positive feedback on my comment on @mauro_oto's post, I thought I'd post this as an answer:

    For me cp /usr/local/opt/readline/lib/libreadline.dylib /usr/local/opt/readline/lib/libreadline.6.dylib did the trick. Looks like rails 4.2.6 was looking for libreadline.6 instead of libreadline. I probably should have symlinked it to be honest though. So ln -s /usr/local/opt/readline/lib/libreadline.dylib /usr/local/opt/readline/lib/libreadline.6.dylib is more appropriate. hope this helps others who are still stuck!

    0 讨论(0)
  • 2020-12-02 15:35

    Based on a comment on the accepted answer with more up-votes than the answer, this seems to be the most popular solution.

    Looks like rails 4.2.6 was looking for libreadline.6 instead of libreadline. So just need to create a symlink.

    ln -s /usr/local/opt/readline/lib/libreadline.dylib \
    /usr/local/opt/readline/lib/libreadline.6.dylib 
    

    Hope this helps others who are still stuck!

    0 讨论(0)
  • 2020-12-02 15:35

    I was experiencing a similar problem but with more updated versions. The error I had was:

    dlopen(/Users/juanjo/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/x86_64-darwin18/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)
      Referenced from: /Users/juanjo/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/x86_64-darwin18/readline.bundle
      Reason: image not found - /Users/juanjo/.rvm/rubies/ruby-2.5.3/lib/ruby/2.5.0/x86_64-darwin18/readline.bundle
    

    The important part is Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib

    Looking at /usr/local/opt/readline/lib/ I saw I had installed libreadline.8.dylib, not 7.

    To solve my problem, guided by the other answers, I had to do the following:

    ln -s /usr/local/opt/readline/lib/libreadline.8.dylib /usr/local/opt/readline/lib/libreadline.7.dylib

    In other words: ln -s /.../[libreadline you have] /.../[libreadline you need].

    0 讨论(0)
  • 2020-12-02 15:36

    None of all this worked for me. I am using osx sierra. This what worked for me.

    ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib
    

    Hope this helps someone out there.

    0 讨论(0)
  • 2020-12-02 15:38

    Ran across this today, to solve it I did:

    brew rm -f readline

    brew install readline

    brew link readline --force

    Hope it helps.

    EDIT: I recently ran into this problem again (after downgrading Ruby) since I wrote this, and I now prefer @califrench's solution from the comments below:

    ln -s /usr/local/opt/readline/lib/libreadline.dylib /usr/local/opt/readline/lib/libreadline.7.dylib

    0 讨论(0)
  • 2020-12-02 15:41

    My ENV: Ruby: 2.2.1, Rails: 4.2.1, macOS Sierra 10.12.4;

    The below command works for me and my colleague:

    ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib

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