Skip to content

Instantly share code, notes, and snippets.

@guiman
Last active December 10, 2015 05:29
Show Gist options
  • Save guiman/4388458 to your computer and use it in GitHub Desktop.
Save guiman/4388458 to your computer and use it in GitHub Desktop.
Work in progress for a rails 4 instalation script using bundler for Mac/Linux systems
TMP_DIR="/tmp/installing_rails_4"
USER_BIN_DIR="~/bin"
curr=`pwd`
if [ -d "$TMP_DIR" ]; then
rm -rf $TMP_DIR
fi
mkdir $TMP_DIR
cd $TMP_DIR
bundle init
echo "source :rubygems" >> Gemfile
echo "gem 'rails', :git => 'git://github.com/rails/rails.git'" >> Gemfile
echo "gem 'uglifier', '>= 1.0.30'" >> Gemfile
echo "gem 'activerecord-deprecated_finders', :git => 'git://github.com/rails/activerecord-deprecated_finders.git'" >> Gemfile
echo "gem 'journey', :git => 'git://github.com/rails/journey.git'" >> Gemfile
echo "Finished creating Gemfile, starting instalation..."
bundle install
if [ ! -d "$USER_BIN_DIR" ]; then
mkdir $USER_BIN_DIR
fi
echo "`bundle show rails`/railties/bin/rails $*" >> $USER_BIN_DIR/rails4
chmod 755 $USER_BIN_DIR/rails4
echo "export PATH=$USER_BIN_DIR:$PATH" >> ~/.bash_rc
cd $curr
rm -Rf /tmp/installing_rails_4
echo "Now you can use rails 4 by the command rails_4_beta"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment