8
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

gem にその場しのぎのパッチを当ててインストールする方法

Last updated at Posted at 2015-01-06

gem の native extension のビルドがコケる、けどPRを送ったりフォークしたりは面倒くさい、今すぐインストールできればそれでいい、というときはこうする。

cd ~/tmp

# gem を取得して展開
gem fetch $gem
gem unpack $gem-x.y.z.gem

# 適当に修正
cd $gem-x.y.z
edit_as_you_want

# gem をパッケージングしてインストール
gem build $gem.gemspec
gem install ./$gem-x.y.z.gem

# 後片付け
cd ..
rm -r $gem-x.y.z{,gem}

Bundler でインストールする gem にパッチを当てたいなら、 bundle install の前に上記手順を実行する。 gem のインストール先は gem install -i /path/to/vendor/bundle ... のように指定する。

8
6
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
8
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?