LoginSignup
159
145

More than 5 years have passed since last update.

gem installでGitHubリポジトリにある最新版をインストールする

Posted at

稀に

masterでは直ってるけど、Rubygemsにはまだ出てないから、Gemfileに

gem 'spring', github: "jonleighton/spring"

って書いて bundle update spring を実行してね。

参考: https://github.com/jonleighton/spring/issues/143#issuecomment-17984728

みたいなことがある。だいたいの場合はこれでいいんだけど、ここで引用しているspringの場合、これで直るのは bundle exec spring だけで、 bundle exec 無しだと実行できない。(僕の勘違いかも知れないので、正しいやり方を知っている人は是非コメントで教えてください。)

我慢して古いバージョンをRubygemsから引っ張ってきてインストールしてもいいんだけど、やっぱりbundlerでインストールしてあるのと同じバージョンにしたい。

で、gemコマンドにはgitリポジトリを指定して直接インストールする機能が無いので、こういう場面ではspecific_installというgemを使う。今回の場合は以下のようになる。

gem install specific_install
gem specific_install -l 'git://github.com/jonleighton/spring.git'
159
145
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
159
145