When Ubuntu Builds Fail on libvips but macOS Does Not
Why a Rails test suite can fail on Ubuntu because of an older native libvips, and how to upgrade it safely without confusing it with the ruby-vips gem.
Why a Rails test suite can fail on Ubuntu because of an older native libvips, and how to upgrade it safely without confusing it with the ruby-vips gem.
How a moving set of Rails CI flakes exposed shared download state, Selenium stale-node retries, and specs asserting before the browser settled.
A practical Rails performance field guide for diagnosing CPU, IO, GVL, GC, memory, Puma, and container-runtime bottlenecks before choosing a fix.
A progressive escalation guide to debugging Ruby applications in Kubernetes production without restarting: rbspy, kubectl debug, signals, rbtrace, and gdb.
Rails 8's load_async runs association queries concurrently instead of one after another, and getting it right means sizing your connection pool correctly.
A keyword-argument mismatch between Ruby 3.4 and connection_pool 3.x breaks RedisCacheStore at Rails 8.1.1 boot, fixed with a patch loaded before initializers run.
Using application services to build test data couples your specs to that business logic, making test suites slow and fragile; Factory Bot traits fix it.
How to wire up VS Code for Ruby debugging with the Shopify Liquid LSP, the rdbg debugger from Ruby's debug gem, and launch configs for RSpec, Minitest, and Cucumber.
A working comparison of how Python, JavaScript, Ruby, PHP, Rust, and Go implement closures and lazy iteration, with a runnable counter and generator example for each.
How Ruby's Global VM Lock limits threaded CPU-bound code, and how Ractor bypasses it entirely by trading shared memory for message passing.
Why Nokogiri XPath queries failed in Docker but not on an M1 Mac: a libxml2 version mismatch caused by indirect dynamic library loading in Ruby.
How British Summer Time breaks Ruby tests, cron schedules, and cloud functions that assume UTC, and how to write timezone-aware specs instead.
本文用 Ruby 代码示例,剖析 DRY 与 AHA、YAGNI 与可扩展性设计、继承与组合等几对看似冲突的编程原则,说明该如何在实践中权衡取舍。
Runtime method overrides work very differently in PHP and Ruby: one has no rollback mechanism, the other builds aliasing and scoping in from the start.
When async updates to the same record can finish in any order, the oldest write can silently overwrite the newest one; here is how to stop that.
Compares Ruby's byebug, Python's pdb, and PHP's Xdebug side by side, with the core commands and a working example for each language.
Comparing Ruby retry patterns, exception-based retry, conditional checks, and exponential backoff, and when each keeps performance acceptable.
How to debug Unicode font rendering in Ruby's Prawn PDF library and work around PDF::Inspector's limits when testing non-ASCII characters like it.
Ruby's filter_map cuts a multi-pass select/map/uniq chain to one pass, and a plain each loop goes further still when performance actually matters.
A Rails.cache TypeError on an anonymous module led into Ruby's Marshal restrictions and the relationship between object_id and C-level memory addresses.
Why Rails caching raises TypeError: can't dump anonymous module with Kaminari-paginated collections, and how to trace and fix the module causing it.
How to run OpenAI's Whisper as a self-hosted speech-to-text REST API with Docker, a Ruby client, and a Kubernetes deployment for transcribing audio.
Comparing rufus-scheduler's in-process polling loop with sidekiq-scheduler's Redis-backed queue to pick the right one for single-process vs distributed apps.
How rufus-scheduler's single-threaded main loop triggers, times out, and runs jobs, and where a timer-based rewrite would scale better.
Rack is the standard interface between Ruby web servers and frameworks, traced here through its middleware stack from request to response.
Why 0.1 + 0.2 doesn't equal 0.3, how Ruby's arbitrary-precision integers avoid overflow, and how JavaScript's BigInt does the same for large integers.
Rounding the same float, 2.675, to two decimal places gives different answers in C#, PHP, Go, Python, JavaScript, and Ruby, for concrete reasons.
Four breaking changes we hit upgrading to Rails 7.2: show_exceptions, array-containment SQL, connection pool locking, and assert_enqueued_email_with.
Ruby's Global VM Lock serializes threads for CPU-bound work, and Ractor works around it with isolated memory, benchmarked here against threads and processes.
Ruby's fail is a plain alias for raise, both dispatch to the same Kernel method, confirmed here in the C source and with an lldb backtrace.
Caching, the Oj gem, eager loading, background jobs, and load_async each cut serialization time for deeply nested Rails associations like classrooms and scores.
delete_all skips callbacks and dependent associations while destroy_all runs them, and picking the wrong one silently breaks counter caches and cascades.
Ruby's 0.1 + 0.33 does not equal 0.43 because of binary floating-point rounding, and Rational, BigDecimal, and tolerance comparisons each fix it differently.
Console-ready Ruby snippets to inspect Sidekiq queues, scheduled jobs, retry and dead sets, and currently running workers when the dashboard is not enough.
What joins, preload, eager_load, and includes actually do in ActiveRecord, shown with real SQL logs, plus the chained calls that quietly bring the N+1 back.
A collection of .irbrc helpers for tracing method calls, logging SQL queries, profiling code, and inspecting Ruby objects during Rails console debugging.
A comparison of Rails session stores: cookie sessions, ActiveRecord, and Redis, including how to share sessions across subdomains and multiple apps.
Why byebug can't break on Devise's metaprogrammed current_user method, and several ways to debug or patch a method that isn't in your source.
A comparison of Discard and ActsAsParanoid, the two common Rails soft-delete gems, and the query and unscope pitfalls each one introduces.
What Rails actually loads when you run a rake task, the console, the server, or tests, and how to load rake tasks in each environment when you need them.
How ActiveRecord's unscope method selectively removes where and order conditions from default scopes, with examples and alternatives like merge and unscoped.