由于libreadline,rails控制台无法加载 [英] rails console doesn't load due to libreadline
问题描述
我最近像这样重新安装了ruby 2.1.2,因为我想安装gem(ruby-debug-ide
)
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-gcc=gcc-4.2
从那时起,我无法使用bundle exec rails c
加载控制台
由于以下错误:
Since then, I can't load my console using bundle exec rails c
due to the following error :
/Users/ohad/.rvm/gems/ruby-2.1.2@aaa/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require': dlopen(/Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/readline.bundle, 9): Library not loaded: @@HOMEBREW_PREFIX@@/opt/readline/lib/libreadline.6.dylib (LoadError)
Referenced from: /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/readline.bundle
尝试了brew uninstall readline
和brew install --build-from-source readline
,但没有解决我的问题.
Tried brew uninstall readline
and brew install --build-from-source readline
which worked but didn't solve my problem.
推荐答案
今天解决了这个问题,我做到了:
Ran across this today, to solve it I did:
brew rm -f readline
brew install readline
brew link readline --force
希望它会有所帮助.
自从我写这篇文章以来,我最近再次遇到了这个问题(在降级Ruby之后),现在我从下面的评论中更喜欢@califrench的解决方案:
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
这篇关于由于libreadline,rails控制台无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!