Skip to content

Instantly share code, notes, and snippets.

@timgentry
Created September 15, 2011 10:20
Show Gist options
  • Save timgentry/1218967 to your computer and use it in GitHub Desktop.
Save timgentry/1218967 to your computer and use it in GitHub Desktop.
Developer setup of a vanilla Lion install
#!/bin/bash
# Run using: bash <(curl -s https://raw.github.com/gist/1218967)
#
# Oracle setup based on Lion fix by jcotter
# https://forums.oracle.com/forums/message.jspa?messageID=9777450#9777450
if ! which gcc >/dev/null ; then
echo
echo "Error: XCode not installed; aborting."
exit
fi
cd ~
#
# Install XCode
#
# Download Unzip instant client to a directory.
#
# Install rvm if you haven't already done so.
#
# Add the following to your bash profile (change directories to match where you put client)
#
# echo "export DYLD_LIBRARY_PATH=\"/Users/$(whoami)/instantclient_10_2/\"" >> ~/.bash_profile
# echo "export TNS_ADMIN=\"/Users/$(whoami)/instantclient_10_2/admin/\"" >> ~/.bash_profile
# echo "export SQLPATH=\"/Users/$(whoami)/instantclient_10_2/\"" >> ~/.bash_profile
# echo "export ORACLE_HOME=\"/Users/$(whoami)/instantclient_10_2/\"" >> ~/.bash_profile
# echo "export NLS_LANG=\"AMERICAN_AMERICA.UTF8\"" >> ~/.bash_profile
# echo "export PATH=\"$PATH:/usr/local/bin/\"" >> ~/.bash_profile
# echo "export PATH=\"$PATH:/Users/$(whoami)/instantclient_10_2/\"" >> ~/.bash_profile
#
# export DYLD_LIBRARY_PATH="/usr/local/oracle/instantclient_10_2"
# export SQLPATH="/usr/local/oracle/instantclient_10_2"
# export TNS_ADMIN="/usr/local/oracle/network/admin"
# export NLS_LANG="AMERICAN_AMERICA.UTF8"
# export PATH=$PATH:/opt/jruby/bin:/usr/local/mysql/bin:$DYLD_LIBRARY_PATH
# export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$HOME/local/node/bin:$PATH"
# Install Homebrew
if ! which brew >/dev/null ; then
echo
echo "homebrew not installed; installing now..."
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
fi
# Install apple-gcc42
if ! which gcc-4.2 >/dev/null ; then
echo
echo "apple-gcc42 not installed; brewing now..."
brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
rvm pkg install openssl
fi
# Install git
if ! brew list git >/dev/null ; then
echo
echo "git not installed; brewing now..."
brew install git
fi
# Install git-flow
if ! brew list git-flow >/dev/null ; then
echo
echo "git-flow not installed; brewing now..."
brew install git-flow
fi
# Install bash-completion
if ! brew list bash-completion >/dev/null ; then
echo
echo "bash-completion not installed; brewing now..."
brew install bash-completion
echo '' >> ~/.bash_profile
echo 'if [ -f `brew --prefix`/etc/bash_completion ]; then' >> ~/.bash_profile
echo ' . `brew --prefix`/etc/bash_completion' >> ~/.bash_profile
echo 'fi' >> ~/.bash_profile
fi
# Install redis
if ! brew list redis >/dev/null ; then
echo
echo "redis not installed; brewing now..."
brew install redis
fi
# Install mysql 5.1 (64 bit)
#if ! brew list mysql >/dev/null ; then
# echo
# echo "mysql not installed; brewing now..."
# brew update
# brew tap homebrew/versions
# brew install homebrew/versions/mysql51
#fi
# Install mysql 5.1 (32 bit)
if ! find /usr/local/mysql/bin/mysql >/dev/null; then
echo "mysql not installed; installing now..."
fi
# Install RVM
if ! which rvm >/dev/null ; then
echo
echo "RVM not installed; installing now..."
\curl -L https://get.rvm.io | bash -s stable
source .bash_profile
rvm notes
fi
# Install 32 bit REE 1.8.7
if ! rvm list | grep "ree-1.8.7-2012.01 \[ i686 \]" >/dev/null ; then
echo
echo "ree-1.8.7-2012.01 not installed; installing now..."
rvm remove ree-1.8.7-2012.01
export CC=gcc-4.2
rvm_archflags="-arch i386" CFLAGS='-m32' CXXFLAGS='-m32' LDFLAGS='-m32' rvm install ree-1.8.7-2012.01
echo
echo "Up/downgrading rubygems to 1.6.2"
gem update --system 1.6.2
echo "Installing ruby-oci8"
gem install ruby-oci8 -v=1.0.7
echo "Installing rails 2.3.5"
gem install -v=2.3.5 rails --no-ri --no-rdoc
echo "Installing other gems"
gem install activerecord-oracle-adapter --source=http://gems.rubyonrails.org --no-ri
gem install highline --version="~> 1.5.0" --no-ri
gem install roo --version="1.9.5" --no-ri
gem uninstall google-spreadsheet-ruby
gem install google-spreadsheet-ruby -v=0.1.5 --no-ri
gem install turn --no-ri
gem install mongrel --no-ri
fi
rake gems:install
# echo '--- Installing ruby 1.9.2'
# rvm_archflags="-arch i386" CFLAGS="-arch i386" LDFLAGS="-arch i386" rvm install 1.9.2 --patch osx-arch-fix
# echo '--- Installing ruby 1.8.7'
# rvm_archflags="-arch i386" CFLAGS="-arch i386" LDFLAGS="-arch i386" rvm install 1.8.7-p249 --patch osx-arch-fix
# rvm gemset create rails3
# rvm use 1.9.2
# gem install ruby-oci8
# rvm use 1.8.7
# gem install ruby-oci8
# Run on command line:
#
# rvm_archflags="-arch i386" CFLAGS="-arch i386" LDFLAGS="-arch i386" rvm install 1.9.2 --patch osx-arch-fix
#
# rvm use 1.9.2
#
# gem install ruby-oci8
echo '--- Installing rails3 gemset'
rvm 1.8.7-p249@rails3
gem install rails -v 3.0.10
# If you’re using Rails 3.0 then you’ll need to specify a 0.2.x version of the mysql2 gem in your Gemfile:
#
# gem 'mysql2', '~> 0.2.7'
# env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
echo '--- Installing rails2 gemset'
rvm 1.8.7-p249
gem install rails -v 2.3.5
# rvm install 1.8.7-tv1_8_7_249
sudo ln -s /usr/bin/java /bin/java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment