5 ms·
I love Ruby - Rails has been my day job for the past decade and my life is so much more pleasant when working with it than the odd time I've ventured off into t
by rubyist5eva 5y ago
I love Ruby - Rails has been my day job for the past decade and my life is so much more pleasant when working with it than the odd time I've ventured off into things like Go or Java.
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"
- nitrogen 5y agoI'm curious, do you know what function was being declared implicitly? That's really atypical in modern C code, so there's probably a missing #include somewhere that could be fixed upstream.
- rubyist5eva 5y agoWe're on an older version of Ruby so that's the most likely reason. MacOS Monterrey is really new and we deploy to RHEL so the differences in versions can be fairly stark.
- weatherlite 5y agoSo what's the upside for you with Sinatra? I'm embarrassed to having been doing Ruby for 8 years and never touching it. Just never saw the need - Rails in API mode seems adequate.
- vidarh 5y agoSinatra is small (the main part is about 2k lines). That's the main upside and/or downside depending on your philosophy. As someone who likes to know what goes on, I love Sinatra, but Sinatra does force you to pull in other code as needed yourself - you don't get handheld the way you do with Rails. 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.
- jamesgeck0 5y agoSinatra and the Camping microframework were an enormous help for me when I first started learning Ruby. Being able to read a minimal implementation of routing (for example) helped dispel a lot of the magic that I got hung up on in Rails.