rails c not working in rails 5

半腔热情 提交于 2019-12-03 05:18:52

I recently had this problem when I updated HomeBrew, I'm also working with rails 5 and found this solution and it worked for me:

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

Source: https://gist.github.com/mcshakes/c87e8adda174c73be354094800b9756d

UPDATE

For readline 8 and newer versions, follow the answer given by @Cody Elhard

As a general approach if this error occurred due to updating readline with homebrew

New version can be found by reading the output of brew install readline

My output: readline 8.0.0 is already installed and up-to-date

Old version can be found by load error

My error (Note the 7): Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)

ln -s new_version/path/to/readline original_version/path/to/readline

In my case my command was

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

I fixed this issue by simply adding this gem gem 'rb-readline' and running bundle.

rb-readline

Shawn Wilson

This is a standard fix to this issue try this.. It should get you going

brew rm -f readline

brew install readline

brew link readline --force

here is a reference link rails console doesn't load due to libreadline

Another issue might be which version of ruby is in your path - double check that as well.

ruby -v
ls -la `which ruby`

then check your PATH

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!