Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (41 sloc) 1.47 KB
---
title: Support for Windows Gemfiles
owner: Buildpacks
---
<strong><%= modified_date %></strong>
This topic describes how the Ruby buildpack handles dependencies on Windows machines.
## <a id='gemfiles'></a>Windows Gemfiles
When a `Gemfile.lock` is generated on a Windows machine, it often contains gems
with Windows-specific versions. This results in versions of gems such as
`mysql2`, `thin`, and `pg` containing "-x86-mingw32." For example, the `Gemfile` may contain the following:
```
gem 'sinatra'
gem 'mysql2'
gem 'json'
```
When you run `bundle install` with the above `Gemfile` on a Windows machine, it results in the following `Gemfile.lock`:
```
GEM remote: http://rubygems.org/
specs:
json (1.7.3)
mysql2 (0.3.11-x86-mingw32)
rack (1.4.1)
rack-protection (1.2.0)
rack sinatra (1.3.2)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
tilt (1.3.3)
PLATFORMS x86-mingw32
DEPENDENCIES
json
mysql2
sinatra
```
Notice the "-x86-mingw32" in the version number of `mysql2`. Since Cloud Foundry runs on Linux machines, this would fail to install. To mitigate this, the Ruby Buildpack removes the `Gemfile.lock` and uses Bundler to resolve dependencies
from the `Gemfile`.
<p class="note"><strong>Note</strong>:
Removing the <code>Gemfile.lock</code> will cause dependency versions to be resolved
from the <code>Gemfile</code>. This could result in different versions being installed than
those listed in the <code>Gemfile.lock</code>.
</p>