CS 141 Lab 0 -- Installing Ruby
To be done during class on Weds
Work in pairs.
With two brains instead of one there is a better chance that at least one of you will remember the
necessary details! First install on one partner's account, then on the other's (yes, you must log out and log back in as the other person, log out is under the Apple icon). This lab assumes you are using Safari on one of the classroom machines, running as a Mac. Start Safari by clicking its icon (looks like a compass).
There are two parts to this lab: 1) Install Ruby on your home directory.
2) Run the program I wrote in class (which is included in the installation).
- Copy the cs141.zip file from Examples Presented in Class (on the class webpage) to the root of your home directory
-- here's how to do that...
- Open your home directory (on the network server)
- Get to the Finder by clicking its icon
all the way to the left, or cmnd-tab and select that icon. You should see your login name in the title bar.
- Navigate to your home directory on the network server
- Click on netfiles (in the left pane, just under SHARED (it should show you the root of your
home drive under netfiles.willamette.edu Connected as:
- Click on your home directory (your login id with the folder next to it) to select it
- Go to Examples Presented in Class
- click on the dist141.zip file (on the blue link); when you do that it will download to the machine you are sitting at and a down arrow in a
box will appear on the
upper right of the browser window
- click that down arrow, and it will show a folder named cs141 and a magnifying glass to the right
- click and drag that folder into the Finder window with your name at the top -- if you can't see that window, cmnd-tab to get it on top and move
it so it will show when you switch back to the browser window (or copy (cmnd-c) the folder, then click in the Finder window and paste (cmnd-v))
- That's it!
- You can now run the Ruby program
to accomplish task1_1 (the one I wrote in class) by following these steps:
- Start NetBeans (click the NetBeans icon in the dock; it looks like a cube)
- Close any open projects -- in the Project tab in the left-hand pane, select all then right-click and choose close. Close them all!
otherwise funny things may happen.
- Open the Ruby project
- Start with: File/Open Project
- navigate to /Volumes/jstudent/cs141 -- except your login id instead of jstudent (double-click on folders to open them) -- here's how (btw: this is easy once you know how... like everything!!)
- click the Open parent folder button (the left-most of the three just
below the title bar on the right -- it has a folder with a bent up-arrow on it like this)
until the drop-down menu to the left shows as /
-- this is the "root" of the disk on the machine you are sitting at
- double-click Volumes (way down at the bottom)
- double-click your login id (then you will be attached to your network drive)
- double-click cs141
- double-click the folder named ruby whose icon has a coffee cup, this shows it is a NetBeans project
- dismiss (i.e. close) the error panel if it pops up (after clicking the Do not show this message again box, please)
- The ruby project should now be under the Projects tab, way over on the left. To see the files in it, click the little arrow on the left of ruby,
then the little arrow by Source Packages, then the little arrow
next to ruby, then double-click Program.java to open the code you will modify.
- If you have closed all the other projects, Ruby is now the main project -- NetBeans displays the name of the main project
in bold; when you press F6 it runs the main project... so if something else is bolded, right-click Ruby and select Set As Main Project
- Press F6 to start up the Ruby simulator. If everything has gone right, you should see
the starting situation for task1_1 on the left, the program to accomplish that task on the
right, and the status windows down below
- press Start, then Step repeatedly to watch Ruby collect the coin and take it home (look in
the status window after each step to see the values updated)
- if it says "Success!" when Ruby halts, everything worked and you are ready to program Ruby yourself.