Skip to content

Instantly share code, notes, and snippets.

@andynu
Created January 20, 2026 15:30
Show Gist options
  • Select an option

  • Save andynu/d5f738e30a0dfe5222128e9039231198 to your computer and use it in GitHub Desktop.

Select an option

Save andynu/d5f738e30a0dfe5222128e9039231198 to your computer and use it in GitHub Desktop.
---
- name: ruby build dependencies
apt:
pkg:
- git
- build-essential
- libssl-dev
- zlib1g-dev
- libreadline-dev
- libffi-dev
- libyaml-dev
- libgdbm-dev
- libncurses5-dev
become: true
- name: rbenv (clone)
shell: git clone https://github.com/rbenv/rbenv.git ~/.rbenv
args:
creates: ~/.rbenv
- name: rbenv-build (dir)
shell: mkdir -p ~/.rbenv/plugins
- name: rbenv-build (clone)
shell: git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
args:
creates: ~/.rbenv/plugins/ruby-build
- name: compile bash extensions
shell: cd ~/.rbenv && src/configure && make -C src
args:
creates: ~/.rbenv/src/realpath.o
- name: init zsh path
lineinfile:
path: ~/.zshlocal
line: 'export PATH="$HOME/.rbenv/bin:$PATH"'
create: yes
- name: init rbenv
lineinfile:
path: ~/.zshlocal
line: 'eval "$(rbenv init -)"'
- name: install ruby
shell: zsh -lc 'rbenv install -s 4.0.0'
- name: global ruby
shell: zsh -lc 'rbenv global 4.0.0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment