Skip to content

Instantly share code, notes, and snippets.

@JeffCohen
Last active December 26, 2017 17:27
Show Gist options
  • Save JeffCohen/60e8d8e3be66d4f167b1249fb1bd451a to your computer and use it in GitHub Desktop.
Save JeffCohen/60e8d8e3be66d4f167b1249fb1bd451a to your computer and use it in GitHub Desktop.
# Run this script with:
# curl -sL https://gist.github.com/JeffCohen/60e8d8e3be66d4f167b1249fb1bd451a/raw | bash -E -
cd
echo
echo "Web Development Setup Script for Mac, Version 0.15"
echo
echo "This will take about 25 minutes. Do not turn off your computer until this is complete."
echo "All progress is being recorded to a file named install-log.txt"
echo
echo "Starting installation at $(date)" | tee -a ~/install-log.txt
# Based on GoRails
echo "Step 1 of 4: Installing Ruby 2.4 so you can write your own code" | tee -a ~/install-log.txt
brew install rbenv ruby-build >> ~/install-log.txt 2>&1
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
# Install Ruby
rbenv install 2.4.2 >> ~/install-log.txt
rbenv global 2.4.2 >> ~/install-log.txt
echo "Step 2 of 4: Installing the RubyGems system so you can install cool things" | tee -a ~/install-log.txt
echo "gem: --no-document" >> ~/.gemrc
gem update --system >> ~/install-log.txt
echo "Step 3 of 4: Customizing your command-line environment to match the classroom" | tee -a ~/install-log.txt
curl -sL https://www.jeffcohenonline.com/templates/law713.rb -o "rails-template.rb"
curl -sL https://www.jeffcohenonline.com/templates/law-rc.txt -o ".railsrc"
echo 'set bell-style none' >> ~/.inputrc
source ~/.inputrc
echo "export LS_COLORS='di=1;36:ln=36:so=32:pi=33:ex=31:bd=36:cd=0:su=0:sg=0:tw=0:ow=0'" >> ~/.bash_profile
echo 'export PS1="\w $ "' >> ~/.bash_profile
echo 'alias ll="ls -l"' >> ~/.bash_profile
cd
mkdir -p code
echo 'cd ~/code' >> ~/.bash_profile
source ~/.bash_profile
echo "Step 4 of 4: Installing Ruby on Rails - this might take a while..." | tee -a ~/install-log.txt
gem install rails >> ~/install-log.txt
echo "Finished installation at $(date)" | tee -a ~/install-log.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment