by rubyist5eva · 4y ago · 0 comments
For personal things, my bread and butter is Sinatra and Sequel and that's a great combo as well.
My only real issue with it is differences in building native extensions on macos vs linux, usually need to set different compiler flags in the bundle config. Otherwise, works great.
ie. # ~/.bundle/config
---
BUNDLE_BUILD__PG: "--with-pg_config=/usr/local/Cellar/postgresql@10/10.19_1/bin/pg_config --with-cflags=-Wno-error=implicit-function-declaration"
BUNDLE_BUILD__THIN: "--with-cflags=-Wno-error=implicit-function-declaration"
BUNDLE_BUILD__FFI: "--with-cflags=-Wno-error=implicit-function-declaration"
If you need the kitchen-sink you might as well use Rails. But often you might need only a tiny fraction, and Sinatra is small enough to read. If you need a "halfway house" between Sinatra and Rails, Padrino layers nicely on top of Sinatra and you can pick and choose which parts of Padrino you want to use.
My preferred stack is Sinatra + Sequel as the ORM, but if I need something "quick and dirty" I might throw Padrino on top as it's lightweight and unopinionated enough it doesn't get in my face the way Rails does.
The caveat is that if your team is used to Rails chances are they'll hate you if you make them use Sinatra and they don't share a dislike for big frameworks.