I've been a fan of Ruby on Rails since 2004 when 1.0 came out. Weirdly enough I dove into it prior to v1.0 being released in 2004 and used it for fun and work. By the time v2.0 came out 3 years later others on the team had taken lead on Rails development so I kind of haven't really leveled up -- and yet I'm still happy that when I picked up 7.0 to test it out everything felt very familiar. Shame GitHub (2008) hasn't been out yet for me to capture those early Dayne Rails apps.
Install (developer)
Rails via Docker / Docked
docked
is not intended to replace a full development setup. It is merely a way for newcomers to quickly get started with Rails. The included dependencies stick to what you need when running rails new
without additional options.
Rails via rbenv+bundler (recommended)
Digital Ocean's Ubuntu 22.04 is a good guide to follow
- Ubuntu system prep for Ruby via
rbenv
.
sudo apt update && sudo apt upgrade -y
sudo apt install git curl libssl-dev libreadline-dev \
zlib1g-dev autoconf bison build-essential \
libyaml-dev libreadline-dev libncurses5-dev \
libffi-dev libgdbm-dev sqlite3
- rbenv
- The 20.04 Digital Ocean Guide has a good set of instructions for installing and setting up rbenv.
- Check fastruby.io's rails compatibility for ruby to figure out what the latest version of Ruby you want for the latest version of Rails
rbenv init
rbenv install 3.2.2 # see fastruby.io note above.
rbenv global 3.2.2
- Bundler
# skip installing gem docs to speed life up
# echo "gem: --no-document" > ~/.gemrc
if ! test -f ~/.gemrc; then
echo "gem: --no-document" > ~/.gemrc;
fi
# back to the primary mission
gem install bundler
gem env home
# verify it is your .rbenv/versions/[VERSION]/lib/ruby/gems/[VERSION]
- Rails
gem install rails
which rails
# should show $HOME/.rbenv/shims/rails
# verify it is the rails version you wanted
rails -v
# if not you may need to rbenv rehash to update shim link
rbenv rehash
Deploy
no notes yet
Fly.io
need to find those notes - but I was impressed at how easy it was
Security
Rails’ Native Security Features provides a lot of security features, there are at least 4 ways to level up your application’s security with these great tools:
bundler-audit
to find dependencies that are known to have vulnerabilitiesbrakeman
to find idioms/calls that could be dangerous for your applicationrack-attack
to defend your application against bad, abusive clientssecure_headers
to quickly apply several security headers to all your responses
Neat
- Hottable hackathon project airtable clone. Uses Phlex-rails. Phlex-rails is neat but @teknofire is "not a huge fan of using ruby to write html"