Friday, February 18, 2011

How to configure gemfile for windows platform

I use gem bundler for my test and in the past I only run it on Mac and therefore I didn't have to configure it to run in Windows. However, now I need to be able to run gem bundler in Windows, Ubuntu and Mac. This is because there are some gems that I specifically need to install only for Windows.

To configure your gemfile for windows platform, simply use the following syntax in your gemfile:

### windows specific gems ###
gem 'win32-process', :platforms => [:mswin, :mingw]
gem 'win32console', :platforms => [:mswin, :mingw]


### windows specific gems ###
platforms :mswin, :mingw do
gem 'win32console', '1.3.0'
gem 'wind32-process'

The documentation in says that mswin is for Windows but when I try just using "platform :mswin", it does not seem to work on my machine. That's why I add the "platform :mswin, :mingw".

No comments:

Post a Comment