0

When I try to run rails console it blows up and gives me this error:

  Referenced from: /Users/masonry/.rbenv/versions/2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
  Reason: image not found - /Users/masonry/.rbenv/versions/2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle

Unfortunately, reinstalling and relinking readline with homebrew does not do the trick for me.

I've tried including rb-readline in my Gemfile but still not working.

The only way to fix this problem is to completely nuke ruby and reinstall... which takes a long time and is tedious.

I have a suspicion that the source of this problem may be that my gems are being installed to an incorrect directory. Here's where they are being installed:

→ gem env home
/Users/masonry/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0

I am using ruby 2.3.1, so why do I have lib/gems/2.3.0? Maybe that's the problem here?

Community
  • 1
  • 1
binarymason
  • 1,351
  • 1
  • 14
  • 31

2 Answers2

1

Uninstalling and reinstalling ruby 2.3.1 worked for me:

→ rbenv uninstall 2.3.1
→ rbenv install 2.3.1
→ rbenv global 2.3.1 #or rbenv local 2.3.1
→ rbenv rehash

rbenv doesn't have a fancy reinstall command like rvm.

Derek Povah
  • 353
  • 1
  • 3
  • 15
0

I had a similar issue and it was because i had rvm installed with rbenv. i had to uninstall rvm and uninstall ruby then reinstalled ruby and rails entirely. not sure if you have rvm. but i hope this helps or gives you a clue.

kn0t
  • 1
  • 1