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 trialYohan Dantan
2,370 PointsCannot get OS X to use my rbenv installed ruby version
After using homebrew to 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]
I saw in https://teamtreehouse.com/community/cannot-get-os-x-to-use-my-rbenv-installed-ruby-version Matthew pasted in export PATH="$HOME/.rbenv/shims:$PATH" it worked for him but I just get in my command line:
And when I exit out of whatever that and check ruby -v it says:
ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]
but when I do rbenv global command it displays '2.3.0' as the current version...
HELP PLEASE!
2 Answers
Kenan Memis
47,314 PointsHi,
You can place the command
export PATH="$HOME/.rbenv/shims:$PATH"
under /Users/your_user/ directory either one of the (or both) files named .bashrc and/or .bash_profile and run following command(s):
source /Users/your_user/.bashrc
or
source /Users/your_user/.bash_profile
Kenan Memis
47,314 PointsHi,
:) Okey when you just call "export ... " command on command line, you (generally) execute the command for that session of terminal window. When you close the terminal or open a new one, you see that you do not have the result of the command that you previously run.
so, bashrc and/or bash_profile files are good choices for such commands in order to run in every single terminal window, or session. These files are scanned and the code processed for whole system when you start your operating system.
Since you placed a new code to these files after your OS started, by running source command you just reload those files and the newly added code snippet also works for whole system :)
Yohan Dantan
2,370 PointsThanks so much Kenan Memis - you are a legend :)
Yohan Dantan
2,370 PointsYohan Dantan
2,370 PointsKenan Memis thank you! I don't know what you did but the .bash_profile worked - could you please explain what was going on in those commands? For me at this stage it's just magic ha.