RVM shows message and takes time in Regenerating Ruby version Wrappers...

To use specific version of ruby, I used to create file .ruby-version in my rails application. Which will execute when I go to root directory of my project using cd command.

Once I was having problem with RVM changing ruby version. When I do cd to root directory, RVM was taking time to change version and shows message like this :

Creating alias current for ruby-2.2.2....

Regenerating ruby-2.2.2 wrappers......

It takes around 3 seconds to finish which is very annoying stuff.

I found this issue is posted on github issue tracker https://github.com/rvm/rvm/issues/2725 . As per comments the command rvm repair wrappers should solve issue, but it did not.

Basically RVM is using hooks which are configured in ~/.rvm/hooks directory. We can customise it as we want.

So the solution resides in directory ~/.rvm/hooks. I removed after_cd hook and my issue was solved.

You can learn more about hooks from RVM website : https://rvm.io/workflow/hooks and by looking at directory ~/.rvm/hooks

Hope that helps!!