Rails autoload thread unsafe

Rails framework autoloads constants so that in environments like development or test, the app does not need to load everything into memory before serving requests. However, autoloading is known to be thread unsafe in rails (at least for versions less than 6), and if you happen to be using threaded servers like puma or webrick, it’s very easy to step on unexpected issues caused by multiple threads.

Upgrade rails from 4.2 to 5.0

Upgrading rails to a new major version can be tricky because there might be many breaking changes from the framework itself or from many gems used in project that will become either deprecated or unsupported. However, it can also go smooth if done in a right procedural way. This post shares the procedure based on my recent hands-on experience in upgrading rails from 4.2.11 to 5.0.7.2 for our API server. Please be kindly noted that depending on project configuration or dependencies, the upgrading steps might be slightly different for various projects.

Ruby http request with cookie

Ruby http request with cookie.

Ruby parallel gem use cases

Ruby parallel gem use cases.

Ruby rack

Rack is the gem that provides the interface between web frameworks (ruby on rails, sinatra) and web servers (webrick, puma, unicorn) in ruby world.

Ruby rake

Rake is a Make-like task runner in Ruby. First define a list of tasks in ruby syntax in a Rakefile and then invoke the task with rake command.

Ruby bundler

Bundler is for dependency management in ruby projects.

Ruby gems

A ruby gem is a software package that contains a reusable ruby application or library.

Ruby rbenv

rbenv is for managing multiple Ruby versions and here are some of its commonly used commands summarized for quick reference.

JavaScript typeof returns and falsy values

JavaScript typeof returns and falsy values