Skip to content

Instantly share code, notes, and snippets.

@rkh
Created March 19, 2010 10:53
Show Gist options
  • Save rkh/337418 to your computer and use it in GitHub Desktop.
Save rkh/337418 to your computer and use it in GitHub Desktop.
sudo mkdir /usr/local
sudo chown -R `whoami` /usr/local
curl -L http://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C /usr/local
#!/bin/bash
# stolen from http://gist.github.com/265272
set -e
localdir=$HOME/.mongodb
datadir=$localdir/data
conf=$localdir/mongod.conf
agentdir=$HOME/Library/LaunchAgents
agent=$agentdir/org.mongodb.mongod.plist
brew install mongodb
mongod=$(which mongod)
mkdir -p $datadir
mkdir -p $agentdir
# daemon configuration
echo "dbpath = $datadir
# Only accept local connections
bind_ip = 127.0.0.1" > $conf
# write launchd agent
echo "<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC '-//Apple//DTD PLIST 1.0//EN' 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'>
<plist version='1.0'>
<dict>
<key>Label</key>
<string>org.mongodb.mongod</string>
<key>ProgramArguments</key>
<array>
<string>$mongod</string>
<string>run</string>
<string>--config</string>
<string>$conf</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>WorkingDirectory</key>
<string>$localdir</string>
<key>StandardErrorPath</key>
<string>$localdir/error.log</string>
<key>StandardOutPath</key>
<string>$localdir/mongo.log</string>
</dict>
</plist>" > $agent
launchctl load $agent
echo "MongoDB should now be running - check its status at http://localhost:28017/"
brew install mysql
export ARCHFLAGS="-arch x86_64"
launchctl load /usr/local/Cellar/mysql/*/com.mysql.mysqld.plist
mysql_install_db
launchctl start com.mysql.mysqld
rvm ree,1.8.6,1.8.7,1.9.1,1.9.2,rbx-head gem install mysql -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/bin/mysql_config
brew install postgresql
export ARCHFLAGS="-arch x86_64"
initdb /usr/local/var/postgres
launchctl load -w /usr/local/Cellar/postgresql/*/org.postgresql.postgres.plist
rvm ree,1.8.6,1.8.7,1.9.1,1.9.2,rbx-head gem install postgres
mkdir -p ~/.rvm/src/ && cd ~/.rvm/src && rm -rf ./rvm/ && git clone --depth 1 git://github.com/wayneeseguin/rvm.git && cd rvm && ./install
echo 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' >> ~/.bashrc
source ~/.rvm/scripts/rvm
rvm package install iconv
rvm install ree,1.8.6,1.8.7,1.9.1,1.9.2,rbx-head,jruby,macruby,ironruby,maglev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment