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

Install Docker then use rails/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.

Digital Ocean's Ubuntu 22.04 is a good guide to follow

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 init
rbenv install 3.2.2  # see fastruby.io note above.
rbenv global 3.2.2
# 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] 
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

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 vulnerabilities
  • brakeman to find idioms/calls that could be dangerous for your application
  • rack-attack to defend your application against bad, abusive clients
  • secure_headers to quickly apply several security headers to all your responses

Neat