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

Best way to use ruby in Sublime text 2?

I am trying to code in ruby in sublime text 2. A couple of things are happening.

1) I can't save a ruby file in sublime text. I have something like this myprogram.rb

2) When i am in terminal everything looks to be running fine.

Any ideas? What are some ways of using ruby with sublime text? Do I need to install any packages first?

Thank for the help everyone.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

What do you mean when you say you can't save a ruby file and that everything runs fine in the terminal?

Maciej,

While in sublime, I am unable to save my file. In order to see if my program is working. When i say everything runs fine in terminal, I mean that it seems to be running ruby and everything looks okay. Just not sure where to go next. Any suggestions?

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

So you open Sublime, you create a new file, you hit Ctrl+S or go to menu to save a file and what happens exactly at that point? A small window should appear for you to name the file. Perhaps the folder you are saving to does not give you proper permissions and you have to choose another.

Maciej, you were right. I tried a different folder and it worked. Sometimes the simple things are the hardest. Thank you for your help!

1 Answer

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Garrett;

I use Sublime Text 2(ST2), but do not typically develop in Ruby. However, I am able to save *.rb files without issue. There are packages in which you can install in ST2 for Ruby formatting and highlighting. I think the one I use is RubyFormat. If you are uncertain as to how to install packages in ST2, I use Windows and if you go to Preferences > Package Control > Install Package, and then search for Ruby, you should be able to find some options.

Happy coding,

Ken

Ken,

Thanks for your help. I am using a Macbook, but it's a similar process to windows. I still can't seem to integrate it with ruby though. In the package folders i see a lot of different types of options. I'm not sure what any of those do really. I'll keep playing with it.