Learn Ruby The Hard Way

Hello,

So I am a newbie programmer just starting to learn Ruby and am reading Michael Hartl’s book “Learn Ruby The Hard Way”.

In exercise 0 (http://learnrubythehardway.org/book/ex0.html) , he describes the steps a person must take to get his computer to run Ruby, which includes learning how to make a directory in the Terminal, change into a directory in the Terminal and use the editor to create a file in the directory.

I could complete all the steps successfully except step 11 — (Use your editor to create a file in this directory. You will make the file, “Save” or “Save As…,” and pick this directory). — no idea how to do this.

Any help appreciated …

Gengyang

1 Like

Which operating system are you using? Which text editor? Can you launch the text editor? Where are you stuck?

1 Like

Operating System : OSX Yosemite Version 10.10.2
Text Editor : TextWrangler.
Can I Launch the text editor : Yes
Where am I stuck : Step 11 of this tutorial page — http://learnrubythehardway.org/book/ex0.html where it says to " Use your editor to create a file in this directory. You will make the file, “Save” or “Save As…,” and pick this directory. " — How do I do this ?

1 Like

You’ll need to use the file menu. It should look like this:

2 Likes

Ok , got the part about the file menu … but how do you “pick this directory” as per the instructions in the manual ?

I created a new “Hello World” text document and clicked the “Save As…” link , and under the “Where” tab , there were a bunch of folders like “Applications” , “Remote Disk” , “ICloud Drive”, “DropBox”, “Desktop” and “Downloads” … where lies the “directory” where I can save my new created file ?

That depends. When you made the directory in your Terminal, what did you name it?

1 Like

I named it mystuff

CaiGengYangs-MacBook-Pro:~ CaiGengYang$ ruby -v
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
CaiGengYangs-MacBook-Pro:~ CaiGengYang$ mkdir mystuff
mkdir: mystuff: File exists
CaiGengYangs-MacBook-Pro:~ CaiGengYang$ cd mystuff
CaiGengYangs-MacBook-Pro:mystuff CaiGengYang$
[Restored]
CaiGengYangs-MacBook-Pro:mystuff CaiGengYang$

Click this button to expand the file dialog. Then hold Command-Shift-H. That will put you in your home directory. You should be to scroll through and find the directory you named mystuff.

1 Like

K, Thanks alot kofno !

It finally works now … learned something today … Gonna take a break and then come back later to proceed on with exercise 1 and onwards.

Hmm … plan to make some nice web app with Ruby, put it on the internet … get users to test it, get feedback , then iterate the app accordingly …

Gengyang

2 Likes