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 trial
Gabriel Leoni
5,762 PointsIRB different than how it is in video.
When I start IRB I get this:
Gabriels-MacBook-Air:methods gabrielleoni$ irb irb(main):001:0>
However, the video shows this when he starts IRB: 1.9.3-p125 :004 >
So I cannot run the code from my back_account file in sublime text 2.
Please let me know how to update my IRB!
All the best,
4 Answers
Chris Shaw
26,676 PointsHi Gabriel,
IRB allows you to execute any valid Ruby code within the console so any differences between your terminal window and what's in the video shouldn't matter as it's a simple case of you having a newer version of Ruby compared to the video.
Also if you need to execute a .rb file you would use the ruby executable via command line followed by the file name you wish to run, e.g.
ruby filename.rb
NOTE: To execute a file you must be in the same working directory as it, so if you have created the file on your desktop you must change your working directory by using the below command.
cd ~/Desktop
Hope that helps.
Kevin Marshall
3,561 PointsThe difference is the prompt and the fact that the ruby in the video is not the latest release. Do you have Sublime text installed? The whole part before the > character doesn't matter in this case. You are in the irb in either case. His is just showing the ruby version. What error are you getting? You may need to move your file to the proper directory to run it. There is nothing wrong with your irb though.
Alp Eren Can
25,230 PointsHi Gabriel,
If you are watching the videos now, your version of ruby is probably newer than what is being used in the videos. Go to the terminal (if you're on a Mac) and check your version of ruby by writing: ruby -v
What you need is a ruby version manager (rvm, in short) to install the version 1.9.3-p125. Follow this video to install rbenv: http://teamtreehouse.com/library/installing-a-ruby-development-environment/installing-a-ruby-development-environment/installing-ruby-on-mac
Cheers,
Gabriel Leoni
5,762 PointsIt now works! Thank you for the timely and helpful feedback. I'm one step closer!