Ruby and NodeJS setup

We use rbenv for my Ruby development setup, which has been surprisingly effortless to setup and use We use nvm to manage NodeJS

  1. Ruby Installation (Note that this is platform-agnostic, but there are brew packages and the like)
# Install rbenv
git clone ~/.rbenv
cd ~/.rbenv && src/configure && make -C src # If this fails, it doesn't matter

# Install ruby-build, which rbenv uses to grab scripts
mkdir -p "$(rbenv root)"/plugins
git clone "$(rbenv root)"/plugins/ruby-build
  1. NodeJS Installation:
curl -o- | bash
  1. Add stuff to your .bashrc

We have some shell magic to set up our PATH with things, but this only matters if you have a bunch

# Ruby -- you don't have to do this PATH thing as long as you export to it in some way
paths=("$HOME/.rbenv/bin:"   # Ruby
       "$PATH"               # Existing PATH
export PATH=$(IFS=; echo "${paths[*]}")

eval "$(rbenv init -)"

# NodeJS
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/" ] && \. "$NVM_DIR/"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
  1. Then finally you can restart your shell.

Just double check that rbenv and nvm are doing things right:

curl -fsSL | bash

  1. Install NodeJS and Yarn
nvm install 10.17.0
npm install -g yarn
  1. Install Ruby, set it as default, and install Bundler
rbenv install 2.7.4
rbenv global 2.7.4

gem install bundler
  1. Remember to restart your shell afterwards, and to run bundle install, etc. in the PlaceCal repository!