Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Last active August 29, 2015 14:10
Show Gist options
  • Save tkuchiki/e91dccc46041edb1eb3e to your computer and use it in GitHub Desktop.
Save tkuchiki/e91dccc46041edb1eb3e to your computer and use it in GitHub Desktop.
指定ディレクトリ以下の gem ディレクトリをもとに、gem install し直す
source /opt/rh/ruby193/enable
./gem_reinstall.sh /opt/rh/ruby193/root/usr/bin/gem /usr/lib/ruby/gems/1.8/gems
#!/bin/bash
for GEM in $(ls ${2}); do
VERSION=$(echo ${GEM} | awk -F '-' '{print $NF}')
NAME=$(echo ${GEM} | sed -e "s/-${VERSION}//")
echo "## install ${GEM}"
${1} install ${NAME} -v ${VERSION} --no-rdoc --no-ri
#${1} install ${NAME} -v ${VERSION} --no-document
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment