Monday, November 18, 2013

Installing Ruby on Rails on Mac

Staring this series on my journey of learning Ruby on Rails has been challenging.  Why is it that as soon as you make a commitment to spend your "free time" doing something it seems all your "free time" is gone?  The good news is I have an amazing wife who is understanding and has helped me continue moving forward with my goal to learn Ruby on Rails.

The first thing I needed to do was install Ruby on my Macbook Pro.  Yes, even though I am a Microsoft developer by day I only own Macs.  I made the transition around 6 years ago after building my own PCs since I was in high school but that is another topic for another blog post.

All Macs come with Ruby installed and since I recently upgraded to OS X Mavericks Ruby version 2.0.0 was already installed.  So my first step was complete or so I thought.

Using this Ruby Mac Install video as my guide I started installing the following:

  1. Install git v1.8.3.4
    • I already had git installed and a nice prompt setup thanks to my good friend David Hudson.  Here is a picture of it:
      • Feel free to go to my github repository and copy my prompt logic from the bash_profile that is checked in there if you would like a prompt like this.
    • Install curl v7.30.0
    • Install rvm v1.23.15
      • Used this command: \curl -L https://get.rvm.io | bash
        • Next use this command to install requirements for rvm based on the rvm website's install instructions: rvm requirements
        • Be sure that the [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" is in your ~/.bash_profile file

        • Install ruby v2.0.0-p247 
          • I thought since ruby was already installed on my Mac I could skip the step in the video to install ruby using rvm install 1.9.2.  So even though I didn't discover this until the step in the video to create a gemset I put this here so you knew you needed to install ruby using this command: rvm install ruby

          • Create a gemset in rvm for this tutorial

            • Install rails v4.0.1 - decided to use 4.0.1 based on the Ruby on Rails blog.
              • Rails can be installed using this command:  gem install rails --version 4.0.1

                • During rails install there were several ...unable to convert "\x89" from ASCII-8BIT to UTF8 for... error messages.  A quick google search found this stackoverflow question and answer.  This suggested that I needed to update my version of rdoc and then regenerate all my documents with the newer version of rdoc.  Here is the screenshot of the commands:


                    Now that I have ruby, rails, and a few other necessary tools installed I plan to spend some time over the next few weeks learning the ruby syntax and how to build a simple application in ruby on rails.

                    Until next time continue learning!

                    Monday, November 4, 2013

                    A .NET Developer Learns Ruby on Rails Series

                    I have been developing business applications using Microsoft technologies for over 12 years and really enjoy working with them.  However, learning a new language has been on my mind for some time and this weekend I decided to start that process.

                    This is the first in a series of posts that will capture my journey of learning Ruby on Rails as a C# .NET developer and setting up a development environment on my Macbook Pro.

                    Here is a list of resources that are being used to learn Ruby on Rails:
                    1. Installing Ruby On Rails On A Mac blog post by Bret McGowen
                    2. Ruby on Rails Tutorial installation video by rubyonrailstutorial
                    3. Ruby on Rails Tutorial book by Michael Hartl
                    4. Ruby on Rails - A Jumpstart for .NET Developers pluralsight video by Dustin Davis
                    As I continue to learn and develop, I will be adding to this list other resources and refer to in in the coming posts.

                    If you are currently learning a new language and have any tips please post a comment or send me an email with your advice to paul [dot] gower [at] gmail [dot] com.