install ruby with rbenv

[Fix] Build Failed while Installing Ruby with Rbenv on M1 Mac

Error Message Let’s reproduce the error first: Install Ruby with Rbenv $ rbenv install 2.7.2 NOTE: In my M1 Mac, I tried installing various ruby versions with Rbenv like 2.5.0, 2.6.0, 2.7.0, 2.7.1, 2.7.2 and always ran into this same issue. Install error You will get the following error message BUILD FAILED (macOS 11.2.3 using …

[Fix] Build Failed while Installing Ruby with Rbenv on M1 Mac Read More »

mysql2 gem prepared statements

Interact with Mysql Server using mysql2 gem [Part 3] – Prepared Statements

This is the third part of the series where we create a service to interact with MySQL server in rails using mysql2 gem. You can read other parts by following the links below: Interact with MySQL server using mysql2 gem – select operations Interact with MySQL Server using mysql2 gem [Part 2] – Insert and …

Interact with Mysql Server using mysql2 gem [Part 3] – Prepared Statements Read More »

insert using mysql2 gem

Interact with Mysql Server using mysql2 gem [Part 2] – Insert and Update Operations

This is the second part of the series where we create a service to interact with MySQL server in Rails using mysql2 gem. You can read the first part here. Requirements [x] Service to connect with external MySQL server [ ] Perform basic query: select, insert and update [ ] Prepared statement [ ] Perform …

Interact with Mysql Server using mysql2 gem [Part 2] – Insert and Update Operations Read More »

mysql2 gem

Interact with Mysql Server using mysql2 gem [Part 1] – Select operations

Rails has made our lives easier. If we are talking in terms of querying the database, the active record has got us covered. But what if we had to communicate with an external database? Recently in one of the project that I worked on, I had to perform insert, update, select, and other different queries …

Interact with Mysql Server using mysql2 gem [Part 1] – Select operations Read More »

rubocop missing comment

[Fix] Missing top level class documentation comment Rubocop

Rubocop is the best way to enforce best practices in our rails project. While working on the project with rubocop enabled, it’s normal to stumble upon the warning: Missing top-level class documentation comment. [Style/Documentation]. When this happens, we have three options to fix or disable the warning. Warning Missing top-level class documentation comment. [Style/Documentation] Options …

[Fix] Missing top level class documentation comment Rubocop Read More »

react memo

Performance optimization using React.memo()

Introduction React.memo is a higher order component provided by react that will return a memoized version of the component that only changes if one of the props has changed. It is same as PureComponent but instead of classes React.memo is used for functional components. Why use React.memo? React.memo memoizes the rendered output then skips unnecessary …

Performance optimization using React.memo() Read More »