The main things to handle during upgrading API centric application’s rails version from
6.0 include configuration tuning and deprecation warnings fixing.
v2.7.6 is the latest version before
v3.0 at the time of this writing and upgrading to
v2.7.6 may encounter a breaking issue if the application uses libraries that depend on
number could represent. However, when working with applications where you need exchange data with
JSON format, the
bigint values become a problem because
JSON does not know how to serialize
bigint values by default, in such cases, one solution is to convert the
string as this post shows.
Following Upgrade socket.io from v2 to v3, this post is about upgrading
socket.io and its associated packages to the latest versions as of when this post is written and the only setting changes seem to be from the
redis-adapater and the way to import client
io this time (for our specific use case).
socket.io and its related libraries such as socket.io-redis-adapter and socket.io-redis-emitter had a few breaking changes in either functions or behaviors since v3 which might cause issues during the v2-to-v3 migration. This post lists what was encountered and how to solve it for specific use cases based on hands-on experience.
When working under shared linux machine or environment, sometimes it is necessary to hide or protect some files that contain sensitive information, fortunately there is a tool called GnuPG that most Linux distributions already have pre-installed and we can conveniently make use of this tool and this post is about how easy and quick we can use it for a very basic scenario.
Ever wonder where ruby’s
defined? is defined? Because it looks so like a method, you might end up trying to check out a bunch of places, such as:
BasicObject, or even
Module, but only to find no luck locating it in any of such places. Well, only until you’ve realized it, the answer is pretty simple:
defined? is not a method but an operator or a keyword.
In rails apps among the commonly-used two popular web servers, unicorn serves requests with worker processes, while puma can do it with both process workers and threads. Therefore, switching to puma from unicorn can not only help improve concurrency but also reduce memory usage. Plus, since rails 5.0, the default web server used is puma.