Resolving Rails Runtime Errors: A Guide to Handling Unpersisted Changes with with_lockJan 13, 2025·3 min read
Local PostgreSQL Upgrade and Database Restoration GuidePostgreSQL Upgrade and Database Restoration Guide To support the pgvector gem, I upgraded my local Postgres.app from v13 to v17 on macOS. Below is the full upgrade and restoration process for my project. Environment OS: macOS PostgreSQL: Upgraded f...Jun 20, 2025·1 min read
What’s the relationship between require, $LOAD_PATH and $LOADED_FEATURES in Ruby?Feb 13, 2024·3 min read
7 steps I usually do before I involve in a complex feature implementationBefore implementing a new feature, I like to make sure what problems we are going to solve, why we should solve them, and how much time we can implement this feature. Here are 7 steps I usually do before I involve in a complex feature implementation....Jun 12, 2022·4 min read
What's the difference between find_each, find_in_batches, in_batches in Rails?Sometimes we will use klass_name.all to get records from the database. That’ll be ok, if we only have 100 records in the database. However, using klass_name.all might not be the best way to get records, especially when we need to query large numbers ...Feb 7, 2022·2 min read
VS Code x Rubocop - ruby_executable_hooks: No such file or directoryEnvironment macOS Monterey (Version 12.1) Ruby 2.6.6 Ruby version manager: RVM Editor: VS Code To Reproduce: I've installed rubocop gem in my app and add an extension ruby-rubocop in my VS Code. Open VS Code and see the warning messages below. ...Jan 27, 2022·1 min read
How to define a multiline string in RubyNote: The following was tested with Ruby 2.6.6 Keyword: Heredoc What is heredoc? Heredoc is used for a form of multiline strings and preserves the line breaks and whitespace (including indentation) in the text. How to define a heredoc in Ruby? stri...Dec 8, 2021·2 min read
How to turn on the expanded table formatting mode in PostgreSQLNote: The following was tested with PostgreSQL 13.1 Default setting: \x off $ psql myblog_dev myblog_dev=# SELECT "users".* FROM "users" WHERE "users"."role" = 10 LIMIT 1; The output format would be: It was difficult to read the result. Turn on th...Dec 1, 2021·2 min read
6 tips to ensure your rake task runs smoothlyRake is a task runner/task management tool in Ruby. You can create diverse tasks, put tasks in the Rakefile, and execute a command like rake :your_awesome_task. Your task will start running by Rake. In Ruby, you can put task code inside a file named ...Nov 14, 2021·4 min read