1

I'm running Ruby 1.9.2 w/ rbenv. I recently moved my Users directory to a different drive. Ruby and irb show up using which.

$ which ruby
/Volumes/Pig/Users/arrow/.rbenv/shims/ruby

$ which irb
/Volumes/Pig/Users/arrow/.rbenv/shims/irb

However, running irb hangs indefinitely.

I've also been running ruby files under the current config but executing $ ruby -v also hangs.

2
  • What does rbenv versions show? Also have you considered RVM ? Jun 4, 2012 at 22:36
  • $ rbenv versions * 1.9.2-p290 (set by /Volumes/Pig/Users/arrow/.rbenv/version) 1.9.3-p0
    – Jack Frost
    Jun 4, 2012 at 22:51

2 Answers 2

4

rbenv rehash can help solve these sort of problems. Anytime you modify your Ruby installation you need to rerun that command to let rbenv rebuilt its soft-links.

From the command-line output:

rehash        Rehash rbenv shims (run this after installing binaries)

You might also need to tell rbenv where your binaries are again, i.e., rbenv global 1.9.2... and let it adjust things.

Remember, rbenv assumed your binaries were on a different volume so it might have gotten confused and needed you to straighten it out.

The other issue could be that Ruby bound to files on the other volume at compile time (because that's what rbenv does, it compiles Ruby for you) so when the files couldn't be found the apps crashed. Reinstalling rbenv would fix that, as telling it to reinstall a particular Ruby should have fixed it.

1
  • rbenv rehash was the first thing I tried to no avail. Perhaps pointing rbenv to the binaries would have done the trick but I didn't try it before reinstalling which is nearly as trivial.
    – Jack Frost
    Jun 6, 2012 at 21:36
1

I uninstalled/installed rbenv and all is well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.