Rbenv install issues


I just went through the environment set up. rbenv shows up correctly with v 2.3.1 when i enter rbenv version, but when i check ruby -v it says I’m running 2.5.1 and when I check which ruby, I’m in a different directory. Thanks for the help!


I’m also getting this error when I open up a new terminal window.

-bash: /Users/riley/.bash_profile: line 35: syntax error: unexpected end of file

@kevin @Tommy

Any help with where i went wrong is appreciated!

There’s something wrong with your .bash_profile
You will need to post the contents of that file.
To do that run cat ~/.bash_profile and post the output here.

alias laptop=‘bash <(curl -s https://raw.githubusercontent.com/monfresh/laptop/master/laptop)’

export PATH="$HOME/.bin:$PATH"

export PATH="/usr/local/bin:$PATH"

eval “$(hub alias -s)”

source /usr/local/share/chruby/chruby.sh

source /usr/local/share/chruby/auto.sh

chruby ruby-2.5.1

prompt_ruby_info() {
if [ -f “.ruby-version” ]; then
cat .ruby-version

GREEN=$(tput setaf 65)

ORANGE=$(tput setaf 166)

NORMAL=$(tput sgr0)

precmd () { PS1="{ORANGE}[%~] {GREEN}(prompt_ruby_info) {NORMAL}$ " }

export CLICOLOR=1;

export LSCOLORS=exfxcxdxbxegedabagacad;

[[ -s “$HOME/.rvm/scripts/rvm” ]] && source “$HOME/.rvm/scripts/rvm” # Load RVM into a shell session as a function

@ThaBullfrog Thank you for your help!

Delete the line that starts with this:
[[ -s “$HOME/.rvm/scripts/rvm” ]]
from your .bash_profile

Then add these lines to the end of the file:

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

To edit your .bash_profile you can use any text editor.
If you have atom installed you can run this command to open the file:
atom ~/.bash_profile

Once you’re finished editing the file make sure to save then close any terminals and reopen one to test.

You might also need to delete these lines:

source /usr/local/share/chruby/chruby.sh

source /usr/local/share/chruby/auto.sh

chruby ruby-2.5.1

@ThaBullfrog How do i delete and add lines?

What operating system are you on? macOS?

@ThaBullfrog Yes. macOS.

Do you have Atom installed?

If not go to atom.io and install it.

Do you recall installing Monfresh’s Laptop script?

It says “Laptop is a script to set up an OS X computer for web development, and to keep it up to date.”

Now, this script is probably pretty good, but it seems to conflict with the way App Academy wants you to set things up. So, if you’re willing to lose the script, the easiest way to resolve this issue is to delete it.

I do have atom. Hah, yeah I remember downloading that. I was worried that it would mess what I needed for a/A.

Is it okay if we get rid of it?

100%! It was for a different course I did that’s been over for a while.

Okay, first open the terminal and run
atom ~/.bash_profile

Atom should open. If it does’t you need to open Atom manually then on the top bar click
Atom -> Install Shell Commands
Now once the shell commands are installed you can close your terminal, reopen it then try the first step again.

Once you have the file open in atom, delete everything except these lines:

export PATH="$HOME/.bin:$PATH"

export PATH="/usr/local/bin:$PATH"

Alternatively, you can probably get away with deleting your entire .bash_profile
To do that run:
rm ~/.bash_profile
After all, if this ends up deleting something you actually needed you have the backup you posted in this thread.

Awesome. I just followed your instructions and it got rid of the error. Thank you for that!

Do you have any advice on the other part? I just rechecked the commands from the set up instructions and I’m still showing different results.

Right now I’m getting…

Could you post the output from
cat ~/.bashrc

Add RVM to PATH for scripting. Make sure this is the last PATH variable change.

export PATH="$PATH:$HOME/.rvm/bin"
export PATH="$HOME/.rbenv/bin:PATH" eval "(rbenv init -)"