The Winding Road of Procrastination

Articles
I sat down tonight to do some more learning about Ruby. I thought that I'd spend an hour or so and build something trivial, but useful. Well 90 minutes later and I have had an enjoyable evening, but I have yet to write a single line of Ruby code. It started out with a [Ruby tutorial](http://www.ruby-lang.org/en/documentation/quickstart/3/) which had a header on the first line with the standard directive pointing to the executable for the Ruby interpreter. That led me to realize I wasn't 100% sure where that executable was on a Mac. I remembered that there was some kind of command to find these exectuables so off I went to [Google](http://www.google.ca/search?sclient=psy-ab&hl=en&site=&source=hp&q=where%20is%20perl&btnG=Search). My search results led mt to a Perl primer describing the use of the [which](http://htmlfixit.com/cgi-tutes/tutorial_Perl_Primer_002_-_where_to_get_it_-_basic_layout_-_shebang_line.shtml) command. Having used the…
Read More

Ubuntu School – which: Finding Ruby

Projects
I've been getting my feet wet with Ruby the past couple of days and decided to post this as much for my own recollection as anything else. When you're creating a .rb script file the first line (as with nearly all \*nix script files) contains a reference to the executable which should be used to execute the script. ``` #!/usr/bin/ruby ``` But what if you don't know precisely where that file lives? The [which](http://linux.about.com/library/cmd/blcmdl1_which.htm) command will find it for you. Which is a command which provides you the fully qualified path to shell commands, and this includes script hosts like ruby. ``` callisto:~ kdmurray$ which ruby /usr/bin/ruby ``` This also works for Perl, Python and any number of other executables. Ever wonder where the pwd command lives? or nano? or…
Read More