Last active
December 22, 2015 15:09
-
-
Save lsdr/6490560 to your computer and use it in GitHub Desktop.
Scripts and stuff that helped me migrate from rvm to rbenv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# CFLAGS="-arch x86_64 -g -O2" CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" rbenv install 2.0.0-p247 | |
__install_ruby () { | |
local CFLAGS='-arch x86_64 -g -O2' | |
local READLINE=`brew --prefix readline` | |
local OPENSSL=`brew --prefix openssl` | |
if [ -d "$READLINE" ]; then | |
CONFIGURE_OPTS="--with-readline-dir=$READLINE $CONFIGURE_OPTS" | |
fi | |
if [ -d "$OPENSSL" ]; then | |
CONFIGURE_OPTS="--with-openssl-dir=$OPENSSL $CONFIGURE_OPTS" | |
fi | |
echo "CFLAGS='$CFLAGS' CONFIGURE_OPTS='$CONFIGURE_OPTS' rbenv install -v $1" | |
CFLAGS="$CFLAGS" CONFIGURE_OPTS="$CONFIGURE_OPTS" rbenv install -v $1 | |
# rbenv global $1 | |
gem update --system | |
} | |
if [ -n "$1" ]; then | |
echo $1 | |
__install_ruby $1 | |
else | |
echo 'Usage: rbenv-install [ruby-version]' | |
echo ' run `rbenv install -l` to list avaliable rubies' | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd ~; mkdir -p ~/.rbenv/plugins | |
cd ~/.rbenv/plugins | |
git clone https://github.com/chriseppstein/rbenv-each.git | |
git clone https://github.com/sstephenson/rbenv-default-gems.git | |
git clone https://github.com/tpope/rbenv-aliases.git | |
cd .. | |
echo 'bundler' > ~/.rbenv/default-gems | |
echo 'pry' >> ~/.rbenv/default-gems | |
echo 'looksee' >> ~/.rbenv/default-gems | |
echo 'awesome_print' >> ~/.rbenv/default-gems |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# ref: http://robots.thoughtbot.com/post/47273164981/using-rbenv-to-manage-rubies-and-gems | |
brew install rbenv | |
brew install rbenv-gem-rehash | |
brew install ruby-build | |
sh rbenv-plugins.sh | |
sh rbenv-install-cmdline.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment