How can I install a local gem?

前端 未结 9 1936
夕颜
夕颜 2020-11-28 00:47

If I download a .gem file to a folder in my computer, can I install it later using gem install?

9条回答
  •  抹茶落季
    2020-11-28 00:57

    If you want to work on a locally modified fork of a gem, the best way to do so is

    gem 'pry', path: './pry'

    in a Gemfile.

    ... where ./pry would be the clone of your repository. Simply run bundle install once, and any changes in the gem sources you make are immediately reflected. With gem install pry/pry.gem, the sources are still moved into GEM_PATH and you'll always have to run both bundle gem pry and gem update to test.

提交回复
热议问题