Search code examples
rubygithubrbenv

gem hub not found after ruby upgrade


I updated my ruby version to 2.4.4

I am trying to run hub create, but I got the following error:

rbenv: hub: command not found

The `hub' command exists in these Ruby versions:
  2.3.5

I have seen that I have like two gems of hub (or paths) in my computer:

which -a hub
/Users/albertmontolio/.rbenv/shims/hub
/usr/local/bin/hub

I read that I have to uninstall one, so I've done:

gem uninstall -x hub

But still I see the two paths and the error: hub command not found is still there.

Why I can not use the gem hub and how can I fix this issue?


Solution

  • Each Ruby version has a different gem path, so just reinstall hub under Ruby 2.4.4 using gem install hub or delete the shim at ~/.rbenv/shims/hub, so that it uses the copy in /usr/local/bin/hub (likely installed with homebrew).