DrTomAllen.com
[email protected]
  • Dr Tom
  • Now
  • Consulting
    • Testimonials
  • Robotics
    • Publications & Videos
  • Startups
    • Cubescape
    • Triple Point Robotics
    • Triple Point Games
  • Game Design
    • Triple Point Games
  • Blog

Installing ruby + rails + postgresql on Mac OSX Lion

30/11/2012

 
These notes are mostly for my own reference, but will hopefully be useful to other people too.

Get homebrew:
  • ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" (this only works because Lion ships with a built in ruby)

Get ruby version manager (rvm) plus rails: 
  • \curl -L https://get.rvm.io | bash -s stable --rails

Install gcc42 with which to build ruby (because XCode 4.2 now uses clang):
  • brew update
  • brew tap homebrew/dupes
  • brew install autoconf automake apple-gcc42
  • brew link --overwrite apple-gcc42 (you may or may not need this line, and should probably try without the --overwrite first)
  • brew install libksba (some other library needed to by rvm to build ruby from homebrew sources)
  • rvm pkg install openssl

Set rvm to use a recent ruby version by default:
  • rvm use 1.9.3-p327 --default
  • rvm alias create default ruby-1.9.3-p327

Install postgresql:
  • brew install postgresql
  • initdb /usr/local/var/postgres -E utf8
Get postgresql to start automatically login with:
  • mkdir -p ~/Library/LaunchAgents
  • cp /usr/local/Cellar/postgresql/9.1.5/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
  • launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Or start manually with:
  pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
And stop with:
  pg_ctl -D /usr/local/var/postgres stop -s -m fast

Comments are closed.
    This blog is very rarely updated. Having kids will do that.
    ​

    Archives

    October 2022
    August 2021
    October 2019
    June 2019
    February 2016
    July 2015
    July 2014
    June 2014
    February 2014
    October 2013
    September 2013
    May 2013
    April 2013
    March 2013
    November 2012
    September 2012
    August 2012
    June 2012
    May 2012

    Categories

    All
    Coffee
    Hacking
    Programming
    Projects
    Rants
    Robots
    Startups
    Thoughts

    RSS Feed