Removing all installed Gems and starting over

前端 未结 7 1531
逝去的感伤
逝去的感伤 2021-01-29 19:02

I recently started learning Ruby and Ruby on Rails, and have watched a plethora of getting started materials. I have been finding lately that I keep getting errors where gems w

7条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-29 19:14

    Step 1:

    I first kept running into an error that said:

    You don't have write permissions for the /usr/bin directory

    To get permission, I became a root user with (this is potentially dangerous for reasons beyond my current understanding):

    sudo -s
    

    Credit

    Step 2:

    Then, I kept running into an error that said:

    [gem] cannot be uninstalled because it is a default gem

    This allowed me to uninstall everything:

    for i in `gem list --no-versions`; do gem uninstall -aIx $i; done
    

    Credit

提交回复
热议问题