プラットフォームごとにインストールするgemを指定する

Pocket

windowsで開発してる時にlinuxでしか動かないgemはインストールしたくないときに、
Gemfileにこんな感じで書く。

gem '[パッケージ名]', :platforms => [:mswin]

PLATFORMS (:platforms)
If a gem should only be used in a particular platform or set of platforms, you can specify them. Platforms are essentially identical to groups, except that you do not need to use the –without install-time flag to exclude groups of gems for other platforms.
There are a number of Gemfile platforms:
http://gembundler.com/man/gemfile.5.html

投稿者紹介

株式会社ユニキャスト
私たちは、テクノロジに魅せられた個性あふれるメンバーによって構成された茨城県日立市に本社を構えるベンチャー企業です。
”テクノロジを通して「驚き」と「感動」を創造し、人々の「夢」と「笑顔」を支えます。” の経営理念をモットーに明るい未来を描き、ワクワクする企画提案を続けて参ります。

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください