Installing Ruby And Learning It From An Idiot’s Perspective
Picking A Programming Language
I’ve hemmed and hawed over what programming language to learn, and was pretty much settled on PHP…just never got around to learning it. I have put PHP on the side burner for now, because it became obvious on what I should try to pick up. I’m already using Sass, which is a part of Haml, which is a gem….of Ruby. Might as well learn the parent of what I am already starting to use. So, no brainer for me. Is it for you? How the hell would I know? But I’ll tell you my experience so far, which isn’t much.
The Scary Part – Installing it!
NOTE: For people on a PC only as I have no experience doing this on a Mac or Linux machine.
Now that I have installed Ruby three separate times, it has become less intimidating than it was when I first did it. If you are interested in learning Ruby, but have a slight fear in diving in head first, let me tell you what you need to know without all the bullcrap and non-helpful documentation you will read. Ready? Here we go:
- Download Ruby – You want the one under ‘Ruby on Windows’, and the link that says “Ruby 1.9.2-p0 RubyInstaller”
- Double click the .exe file that downloaded onto your machine.
- IMPORTANT: Look at the graphic below, when you get to the screen that shows that, MAKE SURE BOTH OF THOSE CHECK BOXES ARE CHECKED
Do that and you are fine. Without those checked, I could not run Ruby from any directory. Took me a couple of re-installs to figure that out. Congrats, Ruby is installed! Now you might as well get the rest of the crap out of the way. I haven’t gotten into Rails yet, but it seems like that is the framework of choice. Let’s do that next:
- Follow this link to RubyForge
- Look where it says RubyGems, click the download button, and download one of the 1.3.7 files
- Extract/unzip (whatever) the file
- Click on the Windows Icon/Start thing, and type ‘cmd’
- Navigate to the directory for it (for me it was:C:\Users\Jeremy\Desktop\rubygems-1.3.7\rubygems-1.3.7
- note that to change to a directory you type ‘cd’ and the directory name – ‘cd Desktop’ – to go back a directory you type ‘cd..’
- Type ‘ruby setup.rb’ in the command line
- When it is finished, type ‘gem update’ just to make sure
- Type ‘gem install rails’
Let’s install Haml/Sass and Compass while we are at it.
- Type ‘gem install haml’
- Type ‘gem install compass –pre’
Now get up, go grab a beer and watch some SAMCROW cause that was nuts, wasn’t it? Not for newbs, and not for idiots like me. It took me a silly amount of time to get this down.
Is Ruby the language Written For Front End Developers?
What makes Ruby appealing to me, over say learning PHP or any other language is that at first glance it seems to be ‘coding for dummies.’ Why is that, you ask? Because if you have ever looked at PHP code, you will see a lot of extra syntax. Commas, quotes, dollar signs…a ton of stuff like that. In Ruby, a lot of that crap is gone. I want to assign my name to a variable it looks like this:
name = "Jeremy"
I want it to be all uppercase? Fine and dandy…
That simplicity is what attracts me to Ruby, which is probably the same reason I like jQuery. I want a language that is clean and easy to write…and remember. The learning curve seems way lower than something like PHP, and that appeals to me, because I want to learn it quickly. Just looking at beginning examples seems like Ruby is almost an abstraction of a different language. Like someone said, let’s take PHP and take out all the crap. Now, I have no real authority to say that is actually what happened, but that is the feeling I get when I look at sample code.
What I am curious about, is how everything ties together to actually make a site using it. The time spent learning Ruby in the beginning seems to be dedicated to actually learning the language itself, which is what the book I have bought recently, is doing. A “here’s how to do stuff”, and then followed later by “Now that you know what you are doing, let’s do it.” Now, you might say, ya all languages do that, but Ruby is different. I can’t exactly write some code and then preview it in a browser. At least, I don’t know about it yet if there is. The whole experience so far has been “Let’s write out some code in the ‘irb’ (“Interactive Ruby Shell” – which is just typing some Ruby out in the command line to see if it works. So if you expect to type some crap and see the fruits of your labor displayed in its greatness in a web browser, you are going to be disappointed.
The real question though is, because of its…level of abstraction feel, is it a better language for non-programmers (at the moment) to learn first over something like PHP? It sure seems that way because of the learning curve. I fear I am trying to learn Ruby because of that factor, instead of it being the better solution in coding. I’m not all that sure what the advantages/disadvantages are, but half the fun is going to be finding out. Hopefully I am making a good choice in picking Ruby, and if not, I hope I find out quickly.