Tuesday, April 16, 2013

So you are going to learn Rails...

I am proud of and honored to have been chosen as the teacher to the next Introduction to Ruby on Rails Course by teh very fine Redradix.

As it is a very compact course, and covers a broad curriculum it would benefit from everybody having all the tools we are going to need already installed.

Many Ruby resources do a great effort to address all three major OS when preparing installation and set-up instructions. So does Learn Ruby the Hard Way, or Rails Tutorial Book. I appreciate that effort, but I'd rather choose a different path.

I am the teacher, students will have to follow, copy or otherwise mimic many things I will do during the course, GNU/Linux is my OS of choice, so if they are not using it yet (but have a decent machine) they can follow these instructions to minimize environment issues, that should be outside the scope of such a  short course:

Non Linux:

  • Download and install https://www.virtualbox.org/ for your OS
    • Use whatever virtualization software you know/like better if there is one
  • Download a free copy of ubuntu 12.04 desktop 32-bit: http://goo.gl/PZ03Z
    • Use whatever linux variant you like/know better, I say Ubuntu because it's easy to use and easy to find help on the internet due to a huge user community
  • Install Ubuntu from that downloaded ISO file on the virtual machine with default options (again, unless you know better).
  • Install VirtualBoxGuestAdditions (Menu/Device/Install Guest Additions) for a more comfortable screen/mouse integration.
  • Activate shared clipboard (Menu - Device - Share clipboard) so you can, for instance, cut and paste commands
Don't get fancy with the installation, it is not a server, it will not be your development machine, it is a learning environment designed to minimize trouble for a couple of weeks.

When you are done, or if you have Linux already:

Linux instructions:
  • Install RVM prerequisites:
    • sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
  • Install RVM
    •  \curl -L https://get.rvm.io | bash -s stable  --autolibs=enabled
    • source /home/fer/.rvm/scripts/rvm
  • Install ruby 1.9.3
    • rvm install ruby-1.9.3
  • Check rvmrubyirbgem commands
    • me@curso:~$ rvm list
      rvm rubies
      =* ruby-1.9.3-p392 [ i686 ]
      # => - current
      # =* - current && default
      #  * - default
      me@curso:~$ gem -v
      fer@curso:~$ ruby -v
      ruby 1.9.3p392 (2013-02-22 revision 39386) [i686-linux]
      me@curso:~$ gem -v
      me@curso:~$ irb
      1.9.3-p392 :001 > puts 'Hola'
       => nil 
      1.9.3-p392 :002 > quit
  • Configure Gedit (unless you have another favourite editor you are already familiar with)
    • Menu: Edit - Preferences
      • Tab View: all on
      • Tab Editor: tab-width:2, Insert spaces:on, Auto indent: on
I have tested these instructions just before posting, so everything should run smoothly.

But shoulds are cheaper than air in IT.

If you are coming to the course and hit any difficulty or have any doubt following these instructions, drop me a line through any mean listed at http://about.oinak.com/

Anyway, I will carry a copy of the just installed VM to the class for anyone to copy and use on their own VirtualBox, but getting over several gigs during first class is not the easy/fast way.

If you are coming to the course, see you next May 6th, otherwise I hope this post have been useful to you anyway. Whichever the case, thanks and good luck.