Thursday, March 10, 2016

Setting up Ruby on Mac OSX

Mac OSX ships with a version of Ruby, but it is almost out of date. You can see the current installed version by opening a console and typing

$ ruby --version

Regardless of whether the version you see reported is current, old or if Ruby is somehow not available, you'll want to take control of your Ruby version for serious development. You are interested in controlling:

  • which Rubies are installed on your system,
  • which Ruby you happen to be using at any one time
  • which Ruby you expect your users to have to run any Ruby code you develop.
To this end you'll want to take some specific steps to get this kind of control. On OSX this is pretty easy. 

Apart from this sort of control, you'll also want to make sure you can install gems with native extensions. Gems with native extensions need to be compiled on (or for) the target system. Ruby's gem infrastructure needs access to specific system tools and native libraries to do this. 

Google picked this guide when I googled the question about how to install Ruby on Mac OSX. Bear in mind there is more than one way, but it happens this guide mostly mirrors how I have set my local environment up:

  1. Install X-code command line tools (to support native compilation)
  2. Install Homebrew (a package manager for Mac)
  3. Install RVM or RBENV (ruby version managers)
  4. Install your Ruby or Rubies of choice using RVM or RBENV
The guide linked above uses RBENV to manage ruby versions and it has a specific instructions for the entire process. My experience is only with RVM. So if I get a chance I'll investigate further the difference and possible advantages and disadvantages.


Tuesday, March 8, 2016

Tooling on Mac OS for Ruby Development

I mentioned in my previous post I was starting a new project, and interestingly enough, my newish 2015 iMac doesn't have much in the way of tooling for Ruby Development installed.

I quickly fixed this by installing

If I come across any other generic tool I end up using I might add it to this list.

Some basic descriptions are after the break.

Sunday, March 6, 2016

Life - a new casual project

As mentioned in the previous post, I'm interested in doing some more software development in my own time. Here I formally announce a casual project to work on and even more formally denounce myself for having forgotten about it in a few weeks.

Having just read and re-read some books on Darwinism, Natural Selection and Evolution while on holiday, I'm feeling inspired to write some code to demonstrate some of the principles my brain has been turning over. To that end I'm starting a new project I'm calling 'Life'. Its going to be a CLI (Command Line Interface) program written in Ruby. I'm hosting it as a project on Github.

I'll blog some more details about the project - like how I imagine it will work and what things I intend to investigate - soon.

Update - Its been a while

Its been a while since I posted anything to this blog. I've obviously fallen out of the habit of blogging.

I can only blame the fact that every working hour is one I spend directly or indirectly on Software Engineering, and I generally can't blog about it there and then, if at all. My desire to spend precious downtime in the same has been limited by competing priorities of family, good TV, computer games  (long time favourites are Kerbal Space Program and Factorio, if you are wondering) and tiredness.

Still, I've just had a holiday, and in listening to a few different books on evolution and natural selection my interest in observing via simulation some of the properties of these processes has been piqued. It is not the first time.

More to come - a lack of personal time not-withstanding.

Friday, February 22, 2013

No such file or directory?

Sometimes when a shell session shows you this error it baffles. You check the file exists, you check the syntax for the command, you check the permissions. You do everything that a page like this suggests you do.

And then you realise that the entire directory you are attempting to execute a command within has been deleted or recreated since your shell set it as its current working directory.

I stumble across this problem from time to time when I have multiple shell windows open. If you are in a particular directory in session 1, and delete that directory in another, even if you immediately recreate a directory with the same name, all further commands in the first session that are dependent on relative directories are doomed to failure.

This makes sense, but sometimes it takes me a while to remember. Maybe writing this post will trigger my memory earlier in the piece in the future.

Quick Patch, Diff Guide

Yesterday I posted about releasing a patch for the Cloud 9 IDE Meteor patch. I didn't mention I found a nice 10 minute guide to diffing and patching which was a great reference.

Just thought I would pass that along.

Wednesday, February 20, 2013

Getting Meteor Running on Cloud 9 IDE

I have been looking at Meteor recently, which is part of a new breed of JavaScript combined client and server frameworks built on Node.js (DerbyJS is an example of another possibly abandoned framework I found).

If, like me, you would prefer to have to option to develop on Cloud 9 web IDE when circumstances require it you might be wondering how to install Meteor and make it work.

Meteor can run on Cloud 9 IDE but it needs to be patched first to remove some of the assumptions assumptions around the local IP and Port it should use.

Vianney Lecroart (aka acemtp) has already patched Meteor and offers a super-simple way to install Meteor 0.5.4. This works great, but Meteor is now up to 0.5.6 and the auto-update helpfully unpatches the framework.

Based on Acemtp's diff file I have created a patch for Meteor 0.5.6 to run on Cloud 9 and posted it to Github with instructions. Essentially, you need to apply Acetmp's installation and apply my patch using the included shell script (or manually yourself).

This seems to work, but the delivery and installation is very crude. For the moment though, I am up and running with Meteor 0.5.6 on Cloud 9.