1

So I recently started using a new Mac (running macOS 10.15.7 Catalina), and had cloned one of my older Rails projects from GitHub that I'm continuing to work on. When I run bundle install, I receive this error in my CLI:

/usr/local/Cellar/rbenv/1.1.2/libexec/rbenv-exec: /Users/user2/.rbenv/versions/2.5.0/bin/bundle: /Users/user1/.rbenv/versions/2.5.0/bin/ruby: bad interpreter: No such file or directory
/usr/local/Cellar/rbenv/1.1.2/libexec/rbenv-exec: line 47: /Users/user2/.rbenv/versions/2.5.0/bin/bundle: Undefined error: 0

Right off the bat, I knew that this must have something to do with the discrepancy under the Users directory, since I set my project up on my old Mac with my old user name user1, while I set my new user name on my new Mac as user2. After viewing this article here, I tried updating and then upgrading homebrew using brew update and then brew update, but that did not work for me.

Additionally, when I run ruby -v to check which version of Ruby I'm using, I now get this error:

dyld: Library not loaded: /Users/user1/.rbenv/versions/2.5.0/lib/libruby.2.5.dylib
  Referenced from: /Users/user2/.rbenv/versions/2.5.0/bin/ruby
  Reason: image not found
Abort trap: 6

I also tried overwriting the older symbolic link with the newer one:

ln -sfn /Users/user2/.rbenv/versions/2.5.0/bin/bundle

But that didn't work for me either. How can I replace this older path with the newer one to fix these issues?

  • Update: I navigated from the home path into the path as indicated by the error: `/Users/user2/.rbenv/versions/2.5.0/bin` I then opened my text editor and proceeded to overwrite all instances of the old user name `user1` and replace them with the new user name `user2`. – lucaspchartier Apr 26 '23 at 11:54

0 Answers0