8
8

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.

DevKitを使って、Ruby for Windowsでも拡張ライブラリ付きgemをコンパイルする

8
Posted at

RubyInstaller + DevKitを使えば、拡張ライブラリ付きのgemがWindowsでも使えるようになります。

コンパイル済みgemが提供されている場合でもコンパイルした人の環境と自身の環境との違いで上手く動かないことがあったりするので、自力でもコンパイル出来た方が何かと便利です。

RubyInstallerのページからダウンロード

Downloads

Ruby 1.9.3-p125
DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe

辺りがおすすめ。

インストール

使い方

gem installの際に--platform=rubyを付けると、適切なパスが設定されてコンパイル出来るようになります。

# エラー!!拡張ライブラリ付きのgemはコンパイル出来ない
$ gem install json

# --platform=rubyを付けるとコンパイル出来る
$ gem install json --platform=ruby
Temporarily enhancing PATH to include DevKit...
8
8
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
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?