Skip to content

Instantly share code, notes, and snippets.

@xnzac
Created November 18, 2013 07:51
Show Gist options
  • Save xnzac/7524158 to your computer and use it in GitHub Desktop.
Save xnzac/7524158 to your computer and use it in GitHub Desktop.
Simple script to replace first line of Gemfile with taobao's rubygem mirror url for faster bundle install's
# Simple script to replace first line of Gemfile with taobao's rubygem mirror url
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 --local"
bundle install --gemfile Gemfile_taobao --local
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