Skip to content

Instantly share code, notes, and snippets.

@danny-englander
Last active June 11, 2018 23:39
Show Gist options
  • Save danny-englander/44fec7cd807dfe050777595d47c190f1 to your computer and use it in GitHub Desktop.
Save danny-englander/44fec7cd807dfe050777595d47c190f1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Place this in your project at /.docksal/commands and call this file rvm, the name should match the command.
# Run this script as fin rvm.
# Install RVM and dependancies, activate and source it, choose the version.
# These two lines are needed to have a valid RVM install
fin exec bash -c "curl -#LO https://rvm.io/mpapis.asc"
fin exec bash -c "gpg --import mpapis.asc"
# Install RVM.
fin exec bash -c "sudo curl -fsSL "https://get.rvm.io" | bash -s stable --auto-dotfiles --autolibs=enable --ruby"
# Install vim in case we need it.
fin exec bash -c "sudo apt install vim"
# Write rvm source stuff to .bashrc so the system knows about it.
fin exec bash -c "echo '[[ -s "~/.rvm/scripts/rvm" ]] && source "~/.rvm/scripts/rvm"' >> ~/.bashrc"
# Source rvm for good measure.
fin exec bash -c "source ~/.rvm/scripts/rvm"
# Now source .bashrc.
fin exec bash -c "source ~/.bashrc"
# Choose the ruby version we installed.
fin exec bash -c "rvm use ruby-2.4.1"
# Now make sure we are using that version.
fin exec bash -c "ruby -v"
# Install bundler
fin exec bash -c "sudo gem install bundler"
##########
##########
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment