在做rails console这个命令时遇到问题贴在这里
$ rails console
Running via Spring preloader in process 1184
/Users/ZhangJing/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require': dlopen(/Users/ZhangJing/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib (LoadError)
想到现在国内凌晨点slack上助教都休息了吧
于是自己把错误内容仔细看了看,觉得这个是关键词”Library not loaded“
接着google了“rails console Library not loaded”
然后第一个链接指向这里
http://stackoverflow.com/questions/25591527/rails-console-doesnt-load-due-to-libreadline
39票的回答
brew rm -f readline
brew install readline
brew link readline --force
试了没用,啊怎么办
接着往下看,有一个54票的!
”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!“
于是赶紧把
ln -s /usr/local/opt/readline/lib/libreadline.dylib /usr/local/opt/readline/lib/libreadline.6.dylib
贴上了自己的iTerm
耶!!
rails console成功了!!!