Skip to content

Instantly share code, notes, and snippets.

@xnzac
Created June 30, 2014 07:36
Show Gist options
  • Save xnzac/b6d8eddfe60042168d36 to your computer and use it in GitHub Desktop.
Save xnzac/b6d8eddfe60042168d36 to your computer and use it in GitHub Desktop.
bundle_install_taobao.sh
# Simple script to replace first line of Gemfile with taobao's rubygem mirror url
# save as ~/bin/bundle_install_taobao.sh
# create alias in ~/.zsh_alias: alias bi='bash ~/bin/bundle_install_taobao.sh'
# run 'bi' from project folder
echo "Copying Gemfile to Gemfile_taobao using ruby.taobao.org"
echo
taobao="'source http\:\/\/ruby.taobao.org'"
sed "1s/.*/$taobao/" Gemfile > Gemfile_taobao
echo "bundle install --gemfile Gemfile_taobao"
bundle install --gemfile Gemfile_taobao
echo "moving Gemfile_taobao.lock to Gemfile.lock"
mv Gemfile_taobao.lock Gemfile.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment