Notes

Quick notes and solutions to common software development problems. For longer, more thorough writing — see the articles section.

Run Cron Job Manually
7 min read

Run Cron Job Manually

Cron Jobs run at specific time but what if you want to run them manually and immediately? In this blog we will look into a solution using which we can run any of our Cron Jobs manually.

Cron
[Solved] Error while Installing mysql2 Gem in M1 Mac
3 min read

[Solved] Error while Installing mysql2 Gem in M1 Mac

In Ruby on Rails applications with mysql2 gem, mysql2 gem always threw error when trying in the new M1 Mac. The error always said "ld: library not found for -lzstd" and "make failed".

Mysql Ruby on rails
[Solved] .rbenv/shims/ruby: Argument list too long
3 min read

[Solved] .rbenv/shims/ruby: Argument list too long

When running the command to check the ruby version with 'ruby -v', it would take a really long time and return the error '.rbenv/shims/ruby: Argument list too long'

Ruby on rails Ruby
Update Multiple Records at Once in Rails
3 min read

Update Multiple Records at Once in Rails

We can update static values of existing records with the method update_all. But what if we want to update records with different value for different attributes? In this blog, we will be looking at ...

Ruby on rails
Override Default Date Format in Rails Admin
2 min read

Override Default Date Format in Rails Admin

It's always tricky when we need to override default behavior of engine/gems. It was the same case with date format. Rails Admin uses long date format as a default value for formatting the dates, to...

Ruby on rails Rails admin
[Fix] Rails Auto Increment ID Postgres Error
2 min read

[Fix] Rails Auto Increment ID Postgres Error

Fix for the error: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint 'users_pkey' DETAIL: Key (id)=(43957) already exists

Ruby on rails Postgresql
[Fix] Rails server is already running
2 min read

[Fix] Rails server is already running

A server is already running. Check .../tmp/pids/server.pid This error means the rails server suspended or stopped abruptly, due to which background process is already running on the port that rails...

Ruby on rails

Newsletter

Get occasional updates whenever I publish a new article or start a new project. No spam, I promise.