Skip to content

Instantly share code, notes, and snippets.

@npverni
Created August 31, 2009 20:42
Show Gist options
  • Save npverni/178699 to your computer and use it in GitHub Desktop.
Save npverni/178699 to your computer and use it in GitHub Desktop.
Installs Ruby, Rails, RubyGems, MySQL and Git on Snow Leopard
cp ~/.profile ~/.profile.bak
echo 'export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"' > ~/.profile
. ~/.profile
echo 'Creating src directory'
mkdir ~/src
cd ~/src
echo 'Installing MySQL'
curl -O http://opensource.become.com/mysql/Downloads/MySQL-5.1/mysql-5.1.37.tar.gz
tar zxvf mysql-5.1.37.tar.gz
cd mysql-5.1.37
./configure --prefix=/usr/local/mysql --with-extra-charsets=complex \
--enable-thread-safe-client --enable-local-infile --enable-shared \
--with-plugins=innobase
make
sudo make install
cd /usr/local/mysql
sudo ./bin/mysql_install_db --user=mysql
sudo chown -R mysql ./var
cd ..
cd ~/src
curl -O http://hivelogic.com/downloads/com.mysql.mysqld.plist
sudo mv ~/src/com.mysql.mysqld.plist /Library/LaunchDaemons
sudo chown root /Library/LaunchDaemons/com.mysql.mysqld.plist
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist
echo 'installed MySQL'
echo mysql
echo 'Installing Git'
cd ~/src
curl -O http://kernel.org/pub/software/scm/git/git-1.6.4.2.tar.gz
tar zxvf git-1.6.4.2.tar.gz
cd git-1.6.4.2
./configure --prefix=/usr/local
make
sudo make install
cd ..
which git
echo 'Installed git'
echo 'Installing Ruby and Rubygems'
curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p174.tar.gz
curl -O http://files.rubyforge.vm.bytemark.co.uk/rubygems/rubygems-1.3.5.tgz
tar xzvf ruby-1.8.7-p174.tar.gz
cd ruby-1.8.7-p174
./configure --enable-shared --enable-pthread CFLAGS=-D_XOPEN_SOURCE=1
make
sudo make install
cd ..
tar xzvf rubygems-1.3.5.tgz
cd rubygems-1.3.5
sudo /usr/local/bin/ruby setup.rb
cd ..
sudo gem install rails
rails -v
echo 'Done!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment