Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 52 lines (39 sloc) 1.75 KB
#!/usr/bin/env bash
#It is only works on mac, if you want to make it work, please modify it on your own, thx.
echo "Checking for SSH key, generating one if it doesn't exist ..."
[[ -f ~/.ssh/ ]] || ssh-keygen -t rsa
echo "Copying public key to clipboard. Paste it into your Github account ..."
[[ -f ~/.ssh/ ]] && cat ~/.ssh/ | pbcopy
echo "Installing oh-my-zsh profiles …"
curl -L | sh
echo "Installing RVM (Ruby Version Manager) ..."
bash -s stable < <(curl -s
echo "
[[ -s '/Users/`whoami`/.rvm/scripts/rvm' ]] && source '/Users/`whoami`/.rvm/scripts/rvm'" >> ~/.zshrc
source ~/.zshrc
[[ $SHELL == "/bin/zsh" ]] && shellrc="~/.zshrc"
[[ $SHELL == "/bin/bash" ]] && shellrc="~/.bashrc"
[[ -s "/Users/`whoami`/.rvm/scripts/rvm" ]] && source "/Users/`whoami`/.rvm/scripts/rvm" >> $shellrc
source $shellrc
#modify the default URL to TB URL
sed -i '' 's/\/pub/\/mirrors/g' $rvm_path/config/db
echo "Installing ruby readline ..."
rvm pkg install readline
rvm get head
echo "Installing ruby 1.9.3 ..."
#rvm install 1.8.7 --patch railsexpress
#rvm install 1.9.2 --patch railsexpress
rvm install 1.9.3 --with-readline-dir=$rvm_path/usr --patch railsexpress
rvm use 1.9.3 --default
rvm 1.9.3@rails32 --default
#remove the default rubygems source
gem sources -r
gem sources -a
echo "Changing .gemrc to not install the ri and rdoc of rails…"
echo "gem: --no-ri --no-rdoc" >> /Users/`whoami`/.gemrc
echo "Installing the newest version of rails ..."
gem install rails