mystix
8/20/2010 - 6:25 AM

Ruby + Rails setup

Ruby + Rails setup

#!/bin/bash

# for more info, see:
#   - http://blog.therubymug.com/blog/2010/05/20/the-install-osx.html
#   - http://wiki.github.com/mxcl/homebrew/gems-eggs-and-perl-modules


# setup .gemrc for use with RVM (Ruby Version Manager)
echo -e '---
:verbose: true 
:bulk_threshold: 1000 
:sources:
- http://rubygems.org
gem: --no-ri --no-rdoc
:benchmark: false
:update_sources: true 
:backtrace: false' > ~/.gemrc


# install RVM
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
echo -e '
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.' >> ~/.bashrc


# update RVM
rvm get head
#!/bin/bash
RUBY_HEAD=1.9.3

# ------- NOTE: RUN THE rvm-installer.sh SCRIPT FIRST -------

# notes:
# - --with-gcc=clang required for OSX Lion
# - readline required to fix forward-delete in irb (see http://anthonymcook.com/post/9304734590/get-the-delete-key-working-in-irb-on-osx-with-two-lines)
rvm install $RUBY_HEAD --with-gcc=clang --with-readline-dir=`brew --prefix readline`

# install useful gems for use with IRB
rvm $RUBY_HEAD@global
gem install awesome_print builder bundler cheat compass pg powder rack rake thor wirble

# install Rails, and set this ruby+gemset as the RVM default
rvm --default --create $RUBY_HEAD@rails
gem install rails