Is it possible to directly install a gem from a git repository?

后端 未结 1 1831
被撕碎了的回忆
被撕碎了的回忆 2021-02-14 03:57

Using bundler, you can do something like this in the Gemfile:

gem \'my_gem\', :git => \'git@github:me/my_gem.git\'

That builds

相关标签:
1条回答
  • 2021-02-14 04:50

    Because unlike typical Git repositories, GitHub builds gems, if the project is hosted on GitHub and the gem is found in the source list then you can add GitHub to your sources list like this:

    $ gem sources -a http://gems.github.com
    

    and then later install gems as desired in a single step, like this:

    $ sudo gem install username-projectname
    

    Otherwise, there's no one-step solution, and you'll have to do something like this:

    1. download the gem zip/tar file
    2. gem build <gemname>.gemspec
    3. sudo gem install <gemname>-x.x.x.gem
    0 讨论(0)
提交回复
热议问题