Archive for the ‘software development’ category

Getting up and running with Git and Rails on EC2

November 6th, 2011

Here’s a short list of things to do to get Git and Rails running on EC2:

Install Git

sudo yum install -y git
  • sudo yum install -y git

Install Rails

  • sudo yum install -y rubygems ruby-devel gcc libxml2 libxml2-devel libxslt libxslt-devel mysql mysql-devel
  • sudo gem update –system
  • sudo gem install rails

Quick notes on creating a local git branch and pushing it into the wild

December 6th, 2010
  1. Checkout the branch you want to switch from
    git checkout branch_to_branch_from
  2. Create the local branch
    git branch branch_name
  3. Switch to the branch
    git checkout branch_name
  4. Push to Remote
    git push origin branch_name

Busy consultancy life, growing family, and blogging

October 28th, 2010

Just posting because i haven’t posted in months. This is just a post about the interesting balance (or potential lack of it) when running an IT consultancy.

It’s an odd one – business is booming; clients are a-plenty; clients are happy and all extending our working contracts; all is smooth and rosy. But, in this focus on business growth and client satisfaction, there’s little time to give to feeding back into the community: I’m not attending many events; i’m not blogging much; i’m not tweeting many interesting finds. I’m just working hard, making clients happy and getting paid.

I do know others in the community who focus very much on their relationships within the community, and more on sharing and expressing than on earning. I know others who have a dedicated focus on creating products for the future.

So, i have to say that mine is a short-termist view: Generate the revenue and deliver. Of course, along with that comes the creation of some great business relationships (clients and partners), but it’s highly in the present and focused.

So, in fairness, with my family’s desire to move into a much bigger house, i have to say that the business focus isn’t planning to shift within the next 6 months. After that, we’ll see. I definitely want to create a saleable product. Of that, i’m very sure.

More meaningful posts later…

Call TextMate from command line

September 7th, 2009

A really neat feature of TextMate is the ability to call it from the command line and pass a directory or file as the object to open. Works great.

For this to work, you need to run a quick one-liner on the command line:

sudo ln -s /Applications/TextMate.app/Contents/Resources/mate /usr/local/bin/mate

Once done, you can call mate and pass it any object you want to open, such as:

$ mate my_rails_app

and it opens the entire directory as if it were a TextMate project.

Lots more detail available here: http://manual.macromates.com/en/using_textmate_from_terminal.html

Setting up Merb, Cucumber and Webrat (and friends) on Snow Leopard

September 4th, 2009

My upgrade to Snow Leopard killed my Merb, Cucumber and Webrat setup so i had to start afresh. That was the bad. The good is that some manual hacks that were required in Leopard are no longer necessary, meaning I can rely on direct gem installations.

Here’s what i did:

  1. Install Ruby and Gems
    Follow instructions on http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard/
  2. Install merb, rspec, cucumber, merb_cucumber and mongrel and dependencies
    sudo gem install merb rspec cucumber roman-merb_cucumber mongrel term-ansicolor treetop diff-lcs nokogiri do_sqlite3
  3. Install webrat
    sudo gem install hoe hpricot webrat
  4. Fix Firefox bug with Snow Leopard
    For some reason the libsqlite3.dylib  library in FireFox 3.5.2 is out of date and breaks cucumber under Snow Leopard. Thankfully, it’s a simple fix:
    mv /Applications/Firefox.app/Contents/MacOS/libsqlite3.dylib /Applications/Firefox.app/Contents/MacOS/libsqlite3.dylib.orig
    cp /usr/lib/libsqlite3.dylib /Applications/Firefox.app/Contents/MacOS/libsqlite3.dylib
  5. Install Selenium
    sudo gem install Selenium
    sudo gem install selenium-client
  6. Install the textmate cucumber bundle
    http://github.com/bmabey/cucumber-tmbundle/tree/master

Deprecated Instructions on Snow Leopard that were required on Leopard

The following ugly hacks were required on Leopard with it’s default Ruby installation. These are no longer required (at least on my machine) on Snow Leopard:

Manual hack of Selenium

http://wiki.github.com/aslakhellesoy/cucumber/setting-up-selenium

As the instructions recommended replacing the Selemium RC jar file () in the installed gem with one from the Selenium website, i had to find out where the gem had installed. Thankfully, gem -h pointed me toward gem help commands and from there i ran gem environment – This told me where gems are installed locally and i found that Selemium RC had been installed into /Library/Ruby/Gems/1.8/gems/Selenium-1.1.14/ I replaced as advised and then ran selenium from within the app root and all worked fine, using the replacement. I then downloaded and ran the test selenium code from http://github.com/aslakhellesoy/cucumber/tree/master/examples/selenium running selenium in a different console and then running cucumber examples/selenium/features/ . It worked a treat and booted up selenium as required. Great!

Manual hack installation of webrat

Download http://github.com/gwynm/webrat/tree/master tar file. Git clone doesn’t work

sudo gem install hoe hpricot
cd downloaded and untarred file
rake gem
sudo gem install pkg/webrat-0.2.1.gem