Installing Ruby gems not working with Home Brew

后端 未结 7 584
盖世英雄少女心
盖世英雄少女心 2020-12-07 13:57

The gems I install via sudo gem install ... can\'t be executed (I get a command not found). They seem to install into /usr/local/Cellar/

7条回答
  •  日久生厌
    2020-12-07 14:24

    Using the info in Timo's answer, I've got this:

    PATH=/usr/local/opt/ruby/bin:$PATH
    GEMSDIR=$(gem environment gemdir)/bin
    PATH=$GEMSDIR:$PATH
    export PATH
    

    Works for Homebrew, works for the separate gems directory, and doesn't hardcode a Ruby version.

提交回复
热议问题