Ryan Anding
Ryan Anding

Reputation: 31

How do I resolve the message "No such file or directory" after installing rbenv on Mac OS?

When opening my Terminal and/or using an IDE to write code, I get the following message:

-bash: export PATH="/Users/ryananding/.rbenv/shims:${PATH}"
export RBENV_SHELL=bash
source '/usr/local/Cellar/rbenv/1.1.2/libexec/../completions/rbenv.bash'
command rbenv rehash 2>/dev/null
rbenv() {
local command
command="${1:-}"
if [ "$#" -gt 0 ]; then
    shift
fi

case "$command" in
rehash|shell)
    eval "$(rbenv "sh-$command" "$@")";;
*)
    command rbenv "$command" "$@";;
esac
}: No such file or directory

I have followed the instructions found on https://github.com/rbenv/rbenv and the rbenv doctor doesn't show any errors. Any help would be appreciated.

Upvotes: 3

Views: 7964

Answers (3)

leigitwing
leigitwing

Reputation: 1

Try to check your rbenv directory on terminal.

  1. ls -la /usr/local/Cellar/rbenv list rbenv version. For me personly, there is 1.2.0 instaed of 1.1.2 . If there is no rbenv version, using brew install rbenv ruby-build 1
  2. Rewrite the following command in your bash_profile, make sure replace 1.x.x to your rbenv version. source '/usr/local/Cellar/rbenv/1.x.x/libexec/../completions/rbenv.bash'
  3. source ~/.bash_profile

Upvotes: -1

jojo
jojo

Reputation: 699

I solved it in the following way.

$ rbenv rehash

Upvotes: 19

ilgam
ilgam

Reputation: 4450

This line fails during loading of bash

source '/usr/local/Cellar/rbenv/1.1.2/libexec/../completions/rbenv.bash

You need to set right path to rbenv.bash file from /completions folder To find the folder do:

  1. Find version of your rbenv rbenv --version => 1.1.2
  2. Here you should see /completions folder ls -la /usr/local/Cellar/rbenv/1.1.2/
  3. Set right path to rbenv.bash file in your .bash_profile which is source '/usr/local/Cellar/rbenv/1.1.2/completions/rbenv.bash'

Upvotes: -1

Related Questions