Notes

Small, bite sized content I've written. For longer, more thorough writing — peruse the articles section.

Browse by topic

Devise raise validations error when new and old passwords are same

Published by Prabin Poudel 2 min read
cover: Devise raise validations error when new and old passwords are same
Letting users to change their password is a very common feature. In this post we will be exploring the solution for raising validations error when they try to change their password but add the same old password again.

Run Cron Job Manually

Published by Prabin Poudel 6 min read
cover: 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.

[Solved] Ubuntu 22 Temporary failure in name resolution

Published by Prabin Poudel 1 min read
cover: [Solved] Ubuntu 22 Temporary failure in name resolution
The Temporary failure in name resolution error occurs when the system cannot translate a website name into an IP address. We will look at the solution to this issue in this post.

[Solved] Error while Installing mysql2 Gem in M1 Mac

Published by Prabin Poudel 3 min read
cover: [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".

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

Published by Prabin Poudel 3 min read
cover: [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'

Update Multiple Records at Once in Rails

Published by Prabin Poudel 3 min read
cover: 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 the solution on updating multiple records at once in Rails when each record can have different attribute and value.

Override Default Date Format in Rails Admin

Published by Prabin Poudel 2 min read
cover: 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 override the format we can add keys for the long date format in our locale files

[Fix] Rails Auto Increment ID Postgres Error

Published by Prabin Poudel 1 min read
cover: [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

[Fix] Rails server is already running

Published by Prabin Poudel 2 min read
cover: [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 server was previously running on.

[Fix] Issue while installing ruby with rbenv in M1 Mac

Published by Prabin Poudel 1 min read
cover: [Fix] Issue while installing ruby with rbenv in M1 Mac
When installing Ruby with rbenv in M1 Mac, it throws Build fail error with message 'Inspect or clean up the working tree error ...' Today we will look at how we can resolve the error and install the ruby with rbenv in our M1 Mac.