Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMathew Leland
19,236 PointsCannot get OS X to use my rbenv installed ruby version
After using "rbenv install 2.3.0", I successfully installed 2.3.0
Then I used "rbenv global 2.3.0"
now when I use "ruby -v" the terminal returns
ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]
So the ruby version I get from terminal is not the same i installed with rbenv. Is there anything I'm missing? How do I get ruby -v to return the version that I installed with rbenv?
3 Answers
Mathew Leland
19,236 PointsIn case anyone revisits this question, I resolved this by typing this exact line into the command line:
export PATH="$HOME/.rbenv/shims:$PATH"
then ruby -v will then return 2.3.0 (or whatever version you installed). But I have to retype it every time I start a new session.
Nate Meyer
3,887 PointsYou either need to reload your shell (just open a new one), or update your PATH. Walk through the rbenv setup instructions again.
Mathew Leland
19,236 PointsThanks for answering Nate. Obviously I am very new to this, so what would it mean to update the PATH? When I copy and paste the step 2 line, it doesn't seem to really do anything (the terminal does not return anything and ruby -v still returns 2.0.0).
Can you give me an example of how to permanently change the PATH to the .rbenv installed version of ruby?
Charles Cloud
6,134 PointsI think the issue has to do with the version of OSX. I am using 10.10.5 and I think the ~/.bash_profile has been changed for this version onwards. Can anyone confirm this?
Charles Cloud
6,134 PointsThe command is executing but I am still getting the original version from OSX...
Brian Peterson
Python Web Development Techdegree Student 13,634 PointsBrian Peterson
Python Web Development Techdegree Student 13,634 PointsHi Mathew,
Thank you very much for this answer. It saved me quite a bit of frustration.
Sincerely, BP
Mike Ulvila
16,268 PointsMike Ulvila
16,268 PointsI added that PATH to my .zshrc file and it now stays on current version of Ruby. If you're not using zsh you could try pasting it into your .bash_profile.