Skip to content

Instantly share code, notes, and snippets.

@brycejohnston
Last active July 8, 2023 16:41
Show Gist options
  • Save brycejohnston/715abe136b0ef50fdd2736a1f4990b0c to your computer and use it in GitHub Desktop.
Save brycejohnston/715abe136b0ef50fdd2736a1f4990b0c to your computer and use it in GitHub Desktop.
Ubuntu 22.04 Ruby, Elixir, Flutter, etc Development Setup

Ubuntu 22.04 Ruby, Elixir, Flutter, etc Development Setup

Guide to setting up a new Ubuntu 22.04 dev environment with Ruby, Elixir and Node.js installed with the asdf version management tool, as well as Flutter and Rust along with PostgreSQL w/ PostGIS.

Update system and install prerequisite packages

Some of these packages may already be installed

sudo apt-get install autoconf automake make binutils build-essential curl \
 bison dnsutils g++ gcc gdal-bin git \
 htop imagemagick libaio-dev libacl1-dev libbz2-dev libcurl4-openssl-dev libevent-dev \
 libexpat1-dev libffi-dev libgdal-dev libgeos3.10.2 libgeos-dev libgeos++-dev \
 libjpeg-turbo8-dev liblzma-dev libmapnik-dev libncurses-dev \
 libpcre3-dev libproj-dev libpq-dev libreadline-dev libssl-dev libtool libxml2-dev \
 libxml2-utils libxslt1-dev libyaml-dev mapnik-utils \
 nginx postfix postgresql-14 postgresql-14-postgis-3 postgresql-14-pgrouting \
 python3-dev python3-gdal python3-pip python3-numpy python3-numpy python3-pip \
 python3-setuptools redis-server unixodbc-dev libmagickwand-dev \
 xfonts-75dpi xsltproc zlib1g-dev p7zip-full libncurses-dev libncurses5-dev \
 libwxgtk3.0-gtk3-dev libgl1-mesa-dev  libglu1-mesa-dev libssh-dev xsltproc fop \
 libxml2-utils tmux vim emacs libgdbm-dev inotify-tools openjdk-11-jdk libvips42

When postfix install prompt shows up (Choose satellite system)

Git

Set name and email for commits

git config --global user.name "Your Name"
git config --global user.email YOUR@EMAIL.com

Generate an SSH keypair

ssh-keygen -t ed25519 -C "YOUR@EMAIL.com"

Copy the output of this command and paste into github SSH key settings.

cat ~/.ssh/id_ed25519.pub

Check to make sure SSH to github works with your key

ssh -T git@github.com

PostgreSQL

Set postgres user password

sudo -u postgres createuser myuser -s

sudo -u postgres psql
postgres=# \password myuser

# set postgres password as postgres
postgres=# \password 

zsh and oh-my-zsh

sudo apt-get install zsh fonts-powerline
chsh -s $(which zsh)
# logout and back in
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

asdf version manager

git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.12.0

add asdf plugin to ohmyzsh plugins

vim ~/.zshrc

Find the plugins line and update to this:

plugins=(git asdf)

Reload your shell

source ~/.zshrc

Double check asdf command works

asdf

Ruby and Ruby on Rails

asdf plugin-add ruby
asdf install ruby 3.2.2
asdf global ruby 3.2.2
ruby -v

Install bundler and rails

gem install bundler
gem install rails

Node.js

asdf plugin-add nodejs https://github.com/asdf-vm/asdf-nodejs.git
asdf install nodejs lts
asdf global nodejs lts
node -v

Yarn

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install --no-install-recommends yarn

Erlang, Elixir and Phoenix

Erlang

asdf plugin-add erlang
asdf install erlang 26.0.2
asdf global erlang 26.0.2

Elixir

asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf install elixir 1.15.2-otp-26
asdf global elixir 1.15.2-otp-26
elixir -v

Phoenix

mix local.hex
mix archive.install hex phx_new

Flutter

Rust

Install rust with rustup

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Other Tools

wkhtmltopdf

Download the latest ubuntu deb package

wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb

Install

sudo dpkg -i wkhtmltox_0.12.6.1-2.jammy_amd64.deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment