Skip to content

Instantly share code, notes, and snippets.

@walski
Created March 16, 2010 21:46
Show Gist options
  • Save walski/334568 to your computer and use it in GitHub Desktop.
Save walski/334568 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Rails 3 - Quick install via CURL
# This will not install using Gem; can update via git-pull
# curl -L# http://gist.github.com/279171.txt | sh
# Tested on OSX and Ubuntu/Debian
# -- Bryan Goines
git clone git://github.com/rails/rails.git
cd rails
RAILS_ROOT=`pwd`
echo " ==> Creating directory: scripts"
mkdir -p scripts
echo " ==> Downloading Gemfile -> scripts/Gemfile"
curl -L# http://gist.github.com/279073.txt > scripts/Gemfile
echo "gem \"rails\", :git => \"$RAILS_ROOT\"" >> scripts/Gemfile
echo " ==> Downloading rails3_cmds uninstaller -> scripts/.bash_uninstall"
curl -L# http://gist.github.com/279076.txt > scripts/.bash_uninstall
echo " ==> Downloading rails3_cmds installer -> scripts/.bash_install"
curl -L# http://gist.github.com/279075.txt > scripts/.bash_install
echo " ==> Running Gem Bundler"
bundle install --only default
RAILS_BIN="\n
# Rails 3 - $RAILS_ROOT\n
function rails3() {\n
\tRUBY_BIN=\`which ruby\`\n
\tDIR=\`pwd\`\n
\ttest ! \$1 && RUBY_OPT=\"rubygems\" \$RUBY_BIN -C $RAILS_ROOT -r vendor/gems/environment railties/bin/rails\n
\ttest \$1
&& RUBY_OPT=\"rubygems\" \$RUBY_BIN -C $RAILS_ROOT -r vendor/gems/environment railties/bin/rails \$DIR/\$1
&& cp $RAILS_ROOT/scripts/Gemfile \$1/Gemfile
&& cp $RAILS_ROOT/scripts/.bash_uninstall \$1/.bash_uninstall
&& cp $RAILS_ROOT/scripts/.bash_install \$1/.bash_install\n
}\n
"
echo " ==> Appending rails command to ~/.bashrc: type 'rails3' to see help screen"
echo $RAILS_BIN >> ~/.bashrc
echo "type: 'source ~/.bashrc' first before use rails3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment