LoginSignup
15

More than 5 years have passed since last update.

自作gemのインストール方法について

Last updated at Posted at 2015-07-29

概要

  • 自作のgemや、OSSのgemをカスタマイズして、インストールする際の備忘録です。

Local gem install

  • localの専用ツール1回インストールして、プロジェクト関係なく使用する際に向いてると思います。

# 対象のgemの作業ディレクトリでビルド
$ rake build
 -> pkg/hoge-0.0.1.gem

# pkg/hoge-0.0.1.gem にgemファイルが作成されるため gem install
$ gem install pkg/hoge-0.0.1.gm

Local gem を Gemfileに記述して bundle install

  • 自作のGemを開発しながらやる際には向いてそうです。
  • 作業ディレクトリ/対象のGEMディレクトリ(hoge)
  • 作業ディレクトリ/インストール先プロジェクトディレクトリ/(boo) の想定で記載しております。

# 対象のgemの作業ディレクトリでビルド
$ rake build
 -> pkg/hoge-0.0.1.gem

# bundle installしたい作業ディレクトリに移動
$ cd ../boo/
$ vim Gemfile
  + gem 'hoge', '0.0.1', :path => '../hoge'

$ bundle install

githubからGemfileに記載して bundle install

  • 開発が完了したタイミングでこちらにするといいと思います。

# bundle installしたい作業ディレクトリ
$ vim Gemfile
  + gem 'hoge', :git => 'https://github.com/xxxx/hoge.git', :branch => 'development'

$ bundle install

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
15