binarymason
binarymason

Reputation: 1433

Gems not being installed to correct directory using rbenv

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?

Upvotes: 1

Views: 1546

Answers (2)

Derek Povah
Derek Povah

Reputation: 363

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.

Upvotes: 1

kn0t
kn0t

Reputation: 1

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.

Upvotes: 0

Related Questions