Skip to content

Instantly share code, notes, and snippets.

@alvin2ye
Created January 21, 2010 04:44
Show Gist options
  • Save alvin2ye/282590 to your computer and use it in GitHub Desktop.
Save alvin2ye/282590 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"
gem bundle --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