We use rbenv for my Ruby development setup, which has been surprisingly effortless to setup and use https://github.com/rbenv/rbenv https://github.com/rbenv/ruby-build
We use nvm to manage NodeJS https://github.com/nvm-sh
# Install rbenv
git clone <https://github.com/rbenv/rbenv.git> ~/.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 <https://github.com/rbenv/ruby-build.git> "$(rbenv root)"/plugins/ruby-build
curl -o- <https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh> | bash
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.sh" ] && \\. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \\. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
Just double check that rbenv and nvm are doing things right:
curl -fsSL <https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-doctor> | bash
nvm
nvm install 10.17.0
npm install -g yarn
rbenv install 2.7.4
rbenv global 2.7.4
gem install bundler
bundle install
, etc. in the PlaceCal repository!