luis is a co-founder and social software architect at SyndeoLabs, and a director at Exist Global. he likes building small web toys a whole lot. More ...

quick links to the good stuff

  • 25 First Dates 25 May 2009
  • True Crime: Confessions of a Criminal Mastermind 17 Feb 2009
  • Finding Your Soul Mate: A Statistical Analysis 27 Jan 2009
  • Sex and Schrodinger's Cat 07 January 2009
  • An Extended Rant on Heroes 26 September 2008
  • Zero Barrier 05 May 2008
  • Sweatshop Blogging Economics 08 April 2008
  • The Doomsday Singularity 25 February 2008
  • Piracy and Its Impact on Philippine Music 21 January 2008
  • The Manila Pen-etration by the Hotelier Antonio Trillanes 29 November 2007
  • Journey of a Thousand Heroes 17 December 2006
  • Shake, Rattle & LOL 30 December 2005

    elsewhere online

    • Last.FM
    • Del.icio.us
    • Flickr
    • Plurk
    • Multiply
    • Stumbleupon

    guttervomit

    • 8

      Designer’s Guide to Rails on Windows (Part One)

      10 Feb 2007

      (This guide was initially supposed to be an internal syndeo::media document which I would pass around to the new people joining our team, but as I wasn’t really discussing anything confidential, I figured there was no harm in publishing this on the blog. There are lots of Rails tutorials already out there, but this one explains some fairly specific additional steps, including getting MySQL and subversion running on your Windows developer machine. The main focus of this guide is to get designers up-to-speed as quickly as possible, and as such, it glosses over a lot of the technical information that guides like these ordinarily contain.)

      Before we get started, it’s important to have a basic understanding of exactly what it is that you’re installing on your Windows box.

      Ruby is a scripting language which can be used for many things, although its most common use by far is web programming. When we say we’re installing Ruby, we are actually more precisely installing a Ruby interpreter. An interpreter is a little program that accepts code written in the Ruby language and actually makes it do, you know, stuff. It’s important to note that the interpreter only gets loaded into memory when it’s needed, and then get’s killed right after it’s done doing its thing. (In this manner, it’s different from servers like Apache or MySQL, which hang around in memory waiting for requests to come in.)

      Ruby also has a fairly robust plug-in management system called RubyGems. Plug-ins are exactly what they sound like, they’re additional bits of code that you can “plug in” to the Ruby interpreter to make it do other cool stuff. You will use this A LOT with syndeo::media applications, as it’s simply more efficient to download and then modify a given piece of code than to try to write one from scratch yourself.

      Rails is a framework built using Ruby (hence the full name “Ruby on Rails”). What does Rails actually do? It simplifies a lot of the most common, nitty-gritty aspects of web application development by introducing a boatload of tools and methods into the mix. It also enforces a fairly strict file structure, so that each team member isn’t tempted to do things their own way. (Rails is very big on following “conventions.”) Lastly, it gives you access to a whole mess of plugins written by a fairly active community, which serves to further cut down the amount of time building foundations, and allows you to concentrate on whatever makes your project special. So when we talk about syndeo::media projects, we usually call them “Rails applications” instead of “Ruby applications” since “Rails” is the more specific name.

      MySQL is a database server. A lot of people only know MySQL as that thing that stores your Wordpress blog posts, and indeed, that’s a fairly accurate description of what it does. But MySQL works in a variety of different settings, and as such, this is often the server used for Rails applications as well.

      For non-programmers, databases can be particularly difficult to visualize, as they often don’t have a graphical component that you can look at and click on. We call MySQL a database server because, as mentioned above, it sits around waiting for someone to make a request and then serves data as needed. Who is this “someone”? In some cases, it will be the Ruby interpreter enacting a command written by a developer. In others, it’ll be an actual user typing commands in to the MySQL console. The language we use for these commands is called SQL (alternately pronounced “sequel” and “ess-cue-ell“), and it’s very much like standard English. It’s fairly easy to guess what a SQL query like “SELECT birthday FROM users WHERE username=’luis’” does (it retrieves the birthday of the user named “luis”).

      The good news is that Rails doesn’t really require a deep knowledge of SQL, because a lot of that stuff has been encapsulated in a pretty powerful command called “find”. If you wanted to find all the users in your current database for example, you would say something like:

      User.find(:all)

      If you wanted to grab the data of user “luis,” you would say:

      User.find(:first, :conditions => “username=’luis’”)

      Now, at first glance, that doesn’t look particularly less complicated than the traditional SQL version, but it actually is, and very much so. We’ll go into slightly more detail on retrieving data when we’ve actually got a Rails application running, and you’ll see what I mean.

      subversion is a version-control system. The average person will usually have no idea what that means, but for anyone who is internet-aware, the best example of a version-control system in action is none other than wikipedia. “Version-control” is essentially just keeping track of all the various versions of a particular file, and archiving them in a linear fashion. So when you say you’re at revision 0, you’re currently at the very first version of your code (usually a couple of empty files that don’t do anything). If you check the History tab on any Wikipedia article page you’ll see a nice list detailing the various changes made to the current article over time. Version-control, and svn in particular, helps teams by making sure that nothing that they write is ever lost, and allows you to work simultaneously without worrying that someone is going to overwrite your work by mistake.

      There are two key components to any version-control system: the server and the client. In the case of syndeo::media, we’ve already got an svn server running, so all you have to do is download the client software which will allow you to access the server.

      =======

      Now, since this is still just the introductory essay, we may as well get some work done and start downloading the various items we’ll need to get started.

      Ruby, RubyGems, and a book(!) : http://rubyforge.org/projects/rubyinstaller/

      MySQL: http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-essential-5.0.27-win32.msi/from/pick

      Tortoise, a super-cool subversion client: http://tortoisesvn.net/downloads

      RMagick: http://rubyforge.org/frs/?group_id=12&release_id=8170
      (Scroll to the bottom to find the Windows — or W32 — installer. I’m skipping ahead a little here and actually asking you to download a Rails plug-in. This is because the RMagick installation process on Windows is a painful exercise, so I figured we might as well get an early start on that.)

      You’ll notice that Rails itself is missing from this list. That’s because we’re going to be installing Rails via the Gems system, which means we will not be downloading anything directly. That said, you can grab a standalone gem from this page, if you are so inclined: http://rubyforge.org/frs/?group_id=307)

      Quick links to other articles in this series:

      PART ONE: Introduction to Ruby, Rails, MySQL and Subversion.

      PART TWO: Ruby Installation and Language Primer.

      PART THREE: Rails, MySQL and the Windows Command Prompt.

      PART FOUR: RMagick and Subversion.

      8 Responses to “Designer’s Guide to Rails on Windows (Part One)”

      1. guttervomit » Designer’s Guide to Rails on Windows (Part Two) Says:
        February 10th, 2007 at 2:56 pm

        [...] the first part of this guide we went through some foundational concepts in Rails development, and if you actually managed to [...]

      2. guttervomit » Blog Archive » Designer’s Guide to Rails on Windows (Part Three) Says:
        February 10th, 2007 at 6:49 pm

        [...] the first and second part of this series, we talked about some foundational concepts regarding Rails [...]

      3. guttervomit » Designer’s Guide to Rails on Windows (Part Four) Says:
        February 11th, 2007 at 2:41 pm

        [...] the last three entries in this series, we talked about the various technologies involved in Rails development, and walked through the installation of Ruby, Rails and MySQL. If you’re keeping score, there [...]

      4. Designer’s Guide to Rails on Windows » syndeo::media Says:
        February 11th, 2007 at 2:56 pm

        [...] PART ONE: Introduction to Ruby, Rails, MySQL and Subversion. [...]

      5. SqlServerForum.org » Blog Archive » Designer’s Guide to Rails on Windows (Part One) Says:
        February 20th, 2007 at 12:08 pm

        [...] post by guttervomit and software by Elliott Back Share and Enjoy:These icons link to social bookmarking sites where [...]

      6. BustyBoots Says:
        June 1st, 2007 at 12:34 am

        I don’t want to wait till the end of Summer :( , I want it now. Who with me?
        save your time and join me. ;)

      7. Atlantic Dominion Solutions » Blog Archive » Start From the Beginning - Installing Ruby and MySQL Says:
        June 22nd, 2007 at 9:18 pm

        [...] Windows The interestingly titled blog, guttervomit, did a complete A-Z tutorial for getting everything up and running on Windows. It serves as a great primer, however, you can skip to the installation steps as we will discuss Ruby and Rails in the class. Check it out the tutorial here. [...]

      8. aqikmyfjyd Says:
        August 14th, 2007 at 11:40 pm

        Hello! Good Site! Thanks you! jstlptxaotuot

      Leave a Reply

     

    categories

    • Home
    • Business (103)
      • Acquisitions (15)
      • Goin' Legit (61)
    • Media (326)
      • Artwork (12)
      • Books (22)
      • Comics (9)
      • Movies (140)
      • Music (102)
      • Photography (31)
      • Poker (10)
      • TV (30)
    • Randomness (300)
    • Site News (8)
    • Technology (274)
      • Games (13)
      • Hardware (112)
      • Social Software (45)
      • Software (131)
    • Tutorials (16)

    archives

    • May 2010
    • April 2010
    • February 2010
    • January 2010
    • December 2009
    • November 2009
    • October 2009
    • September 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
    • December 2006
    • November 2006
    • October 2006
    • September 2006
    • August 2006
    • July 2006
    • June 2006
    • May 2006
    • April 2006
    • March 2006
    • February 2006
    • January 2006
    • December 2005
    • November 2005
    • October 2005
    • September 2005
    • August 2005
    • July 2005
    • June 2005
    • May 2005
    • April 2005
    • March 2005
    • February 2005
    • January 2005
    • December 2004
    • November 2004
    • October 2004
    • September 2004
    • August 2004
    • July 2004
    • June 2004
    • May 2004
    • April 2004
    • March 2004
    • February 2004
    • January 2004
    • December 2003
    • November 2003
    • October 2003
    • September 2003
    • August 2003
    • July 2003
    • June 2003
    • May 2003
    • April 2003
    • March 2003
    • February 2003
    • January 2003
    • December 2002
    • November 2002
    • October 2002
    • September 2002
    • July 2002
    • May 2002
    • April 2002
    • February 2002
    • January 2002
    • December 2001
    • November 2001
    • October 2001

    friends

    • Dementia
    • Gabby
    • Gail
    • Gibbs
    • Helga
    • Ia
    • Ina
    • Jason
    • Kaye
    • Lauren
    • Lizz
    • Luna
    • Mae
    • Migs
    • Mike
    • Ryan
    • Sacha
    • Vicky
    • Vida
    • Yuga

    search

    notes

    Guttervomit v3 went online in January, 2008. It uses Wordpress for publishing, and was built largely with Adobe Illustrator and Textmate. Logotype and navigation is set with Interstate.