wiki‎ > ‎

install development environment

Pivotal labs provides a script to automatically install everything using soloist:


some mac osx defautls: https://github.com/mathiasbynens/dotfiles/blob/master/.osx

the following is adapted from http://blog.therubymug.com/blog/2010/05/20/the-install-osx.html


Step 0:

Uninstall MacPorts!

- clean up .bash_profile & .bashrc from mac ports stuff

Prerequisite OS X Apps:

Chrome 
Firefox (+ firebug)
Fluid.app
Gitx
SizeUp
Teleport
xCode

Snow Leopard Samba Fix2

1
2
echo "[default]" >  ~/Library/Preferences/nsmb.conf
echo "streams=no" >> ~/Library/Preferences/nsmb.conf


Install homebrew


sudo mkdir /usr/local

OR if ou already have an /usr/local directory, run:
sudo chmod -R +w /usr/local/
sudo chown -R `whoami` /usr/local


Get git
1 brew install git


Install utilities
1 brew install wget proctools ack ctags-exuberant


Install MacVim

1 brew install macvim

Set up zsh 


http://github.com/21croissants/oh-my-zsh

dotfiles, dev folder


http://github.com/21croissants/dotfiles

Remove system gems

1
2
3
sudo rm -r /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
sudo gem update --system
sudo gem clean

Install rvm on top of zsh

see http://rvm.beginrescueend.com/rvm/install/

bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

-To use ZSH completion for RVM, you can follow these steps:
mkdir -p $HOME/.zsh/rvm
cp $rvm_path/scripts/zsh/Completion/_rvm $HOME/.zsh/rvm

Copy the following before oh-my-zsh loads:

# rvm auto completion
fpath=(~/.zsh/rvm $fpath)

Set up some http://rvm.beginrescueend.com/gemsets/initial/ , create a 
~/.rvm/gemsets/global.gems
and add gems such as:

rake
mongrel
awesome_print
ruby-debug
looksee
wirble
awesome_print
rak
hirb
launchy

check out http://rbjl.net/40-irbtools-release-the-power-of-irb which takes care of most of them

Install openssl


1 rvm package install openssl

Install the rubies to your heart’s content

1
2
3
4
rvm install ree -C --enable-shared=yes
rvm install 1.8.7 -C --enable-shared=yes
rvm install 1.9.2 -C --enable-shared=yes
rvm use 1.8.7 --default


MySQL



1 brew install mysql # Follow instructions

Set up databases with:

    mysql_install_db


If this is your first install, automatically load on login with:

    cp /usr/local/Cellar/mysql/5.1.49/com.mysql.mysqld.plist ~/Library/LaunchAgents

    launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist


If this is an upgrade and you already have the com.mysql.mysqld.plist loaded:

    launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist

    cp /usr/local/Cellar/mysql/5.1.49/com.mysql.mysqld.plist ~/Library/LaunchAgents

    launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist


Note on upgrading:

    We overwrite any existing com.mysql.mysqld.plist in ~/Library/LaunchAgents

    if we are upgrading because previous versions of this brew created the

    plist with a version specific program argument.


To start: launchctl load ~/Library/LaunchAgents/com.mysql.mysqld.plist

To stop: launchctl unload ~/Library/LaunchAgents/com.mysql.mysqld.plist

Or start manually with:

    mysql.server start

==> Summary

/usr/local/Cellar/mysql/5.1.49: 219 files, 45M, built in 10.1 minutes


➜  ~mysql  mysql_install_db

Installing MySQL system tables...

OK

Filling help tables...

OK


To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system


PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:


/usr/local/Cellar/mysql/5.1.49/bin/mysqladmin -u root password 'new-password'

/usr/local/Cellar/mysql/5.1.49/bin/mysqladmin -u root -h jm-macbook.local password 'new-password'


Alternatively you can run:

/usr/local/Cellar/mysql/5.1.49/bin/mysql_secure_installation


which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.


See the manual for more instructions.


You can start the MySQL daemon with:

cd /usr/local/Cellar/mysql/5.1.49 ; /usr/local/Cellar/mysql/5.1.49/bin/mysqld_safe &


You can test the MySQL daemon with mysql-test-run.pl

cd /usr/local/Cellar/mysql/5.1.49/mysql-test ; perl mysql-test-run.pl


Please report any problems with the /usr/local/Cellar/mysql/5.1.49/bin/mysqlbug script!



Postgresql

1 brew install postgresql # Follow instructions

If you get the following error:

FATAL: could not create shared memory segment: Cannot allocate memory

Run this in your terminal window and try the initdb command again.3

1
2
sudo sysctl -w kern.sysv.shmall=65536
sudo sysctl -w kern.sysv.shmmax=16777216

Install global gems


http://github.com/oggy/looksee, awesome_print

mysql& mongrel, ruby-debug, ...


1
2
3
4
5
6
7
8
9
for x in $(rvm list strings)
do
  rvm use $x@global && gem install mysql --\
   --with-mysql-dir=/usr/local \
   --with-mysql-config=/usr/local/bin/mysql_config
  rvm use $x@global && gem install mongrel rake
  rvm use $x@global && gem install ruby-debug looksee wirble awesome_print rak
done

Note: mongrel did not successfully installed on ruby 1.9.2 :-(

This works:
gem install mongrel --pre


Growl

1
2
3
4
5
6
7
8
9
10
11
12
cd ~/Downloads
wget http://growl.cachefly.net/Growl-1.2.dmg
open Growl-1.2.dmg
cd /Volumes/Growl-1.2/Extras/growlnotify/
# Don't use the install shell script
# Use the following:
mkdir -p /usr/local/bin
echo "Creating /usr/local/bin"
mkdir -p /usr/local/man/man1
echo "Creating /usr/local/man/man1"
cp growlnotify /usr/local/bin/growlnotify
cp growlnotify.1 /usr/local/man/man1/growlnotify.1
Other libraries

brew install graphviz


brew install imagemagick (get my commit http://github.com/21croissants/homebrew/commit/08d9d5b2cdadb5d0babac5547f020339fc1d3ea8 to fix the formula before)


brew install memcached

You can enabled memcached to automatically load on login with:
    cp /usr/local/Cellar/memcached/1.4.5/com.danga.memcached.plist ~/Library/LaunchAgents/
    launchctl load -w ~/Library/LaunchAgents/com.danga.memcached.plist

Or start it manually:
    /usr/local/bin/memcached

Add "-d" to start it as a daemon.

mongo : http://blog.nofail.de/2010/07/mongo-ruby-driver-mongoid-and-mongomapper/

node : http://www.olympum.com/internet/why-node-js-matters/

Generate a pubkey for that station

1
2
ssh-keygen -t rsa
# Add public key to your github account

1 It may work for Leopard… I just haven’t tried it yet.

2 More info (Thanks Alan Jones for the tip)

3 Found this here

Comments