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

Ruby

Jimmy Mannan
Jimmy Mannan
5,201 Points

Where can I practice Ruby besides the workspace here?

My internet connectivity is poor( i think) because of which the workspace connection keeps getting broken, sometimes as often as every 10-15 seconds and i have to reload the page. Obviously gets very tedius..Any suggestions on any other workspace kind of place where i can practice.

2 Answers

John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

Like Caleb said, you could use a text editor offline such as Sublime Text or Vim.

When you want to run your scripts (like you do on Workspaces) you can open Terminal (on Mac) or Command Prompt (on Windows) and run the scripts just like you do in the Workspaces console.

ruby rubytest.rb

rubytest.rb would be the file that you have created in your Text Editor of choice.

Remember when you are in the offline console, you will need to navigate to the directory that your script is saved in first before running the script.

I urge everyone who is learning Ruby on Treehouse to do some 'offline' programming like this every now and again. This is how you would program in the 'real world', so it is good to get some experience before having to either experience it during a personal project or worse, for a job.

Jimmy Mannan
Jimmy Mannan
5,201 Points

Thanks John for your detailed answer. I tried it but I must be doing something wrong as I am getting an error " 'ruby' is not recognised as an external or internal command". http://prntscr.com/6vb2u1 I have created a file in notepad++ and saved it as test.rb.

Any ideas what I can do next... thanks jimmy

John Steer-Fowler
John Steer-Fowler
Courses Plus Student 11,734 Points

No problem Jimmy.

Ah, I probably should have mentioned. Workspaces already has a version of Ruby installed.

You will need to have a version of Ruby installed on your local machine in order to run Ruby scripts in the console.

Treehouse have a mini-project for this: Installing a Ruby Development Environment

If you want a really good understanding of the installations of Ruby, work through the entire project I just linked. Otherwise, if you just want to get up and running quickly, just choose the video for whichever Operating System (OS) you are running (Windows or Mac).

Hope this helps

Jimmy Mannan
Jimmy Mannan
5,201 Points

Thanks again.. I am following along with the video tutorial that you linked...taking too long but the good news is that halfway through the install I got ruby command prompt and I can run ruby files through it :-) Aah...life is perfect now!! Just came back to add a dozen more upvotes but unfortunately the forum takes only one per user!!

Have a good day jimmy

Caleb Kleveter
Caleb Kleveter
Treehouse Moderator 37,862 Points

If you have any more issues with running your programs your most likely going to have to change directories, this depends on were it is saved on your computer. The Console Foundations course covers it in this video, you would go to the file that rubytest.rb is contained in.