Browse files

Various tweaks to make gherkin build on Lion

  • Loading branch information...
1 parent 2b12bbf commit ac817b3f61aee34287981e640b08f6a0896c73b5 @aslakhellesoy aslakhellesoy committed Mar 16, 2012
Showing with 32 additions and 14 deletions.
  1. +4 −0
  2. +24 −11
  3. +1 −1 gherkin.gemspec
  4. +3 −2 tasks/ikvm.rake
@@ -1,3 +1,7 @@
+## [2.9.1](
+* The build system and instruction has been updated to work on OS X Lion. (Aslak Hellesøy)
## [2.9.0](
* Added output to Reporter API (Aslak Hellesøy)
@@ -158,14 +158,14 @@ TODO: Make all specs pass with js lexer - replace 'c(listener)' with 'js(listene
### .NET dll
-You must install Mono from source, or use a release of Mono after November 18 2011.
+You must install Mono SDK 2.10.8 or newer.
You must also download NuGet.exe from [CodePlex]( and place it in `/usr/local/nuget/NuGet.exe`. When it's installed, update it and register your NuGet API Key:
# In case we need to update
mono /usr/local/nuget/NuGet.exe Update -self
- # The key is at
+ # The key is at
mono /usr/local/nuget/NuGet.exe SetApiKey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
Now you can build the .NET dll with:
@@ -177,17 +177,30 @@ This should put the dll into `release/nuspec/lib/gherkin.dll`
### MinGW Rubies (for Windows gems)
In order to build Windows binaries (so we can release Windows gems from OS X/Linux) we first need to install MinGW.
-On OS X, download prebuilt binaries (version 4.3.0) from
-Unpack it under /usr/local and add it to your PATH, typically in your `~/.bashrc`:
+Follow the MinGW installation instructions from the [rake-compiler]( project.
+IMPORTANT! You may have to get an older version - gcc 4.7.0 is experimental. See [this issue](
- export PATH=$PATH:/usr/local/i386-mingw32-4.3.0/bin
+Now, make sure you have openssl installed:
+ brew install openssl
+Next, we're going to install Ruby 1.8.7 and Ruby 1.9.3 for MinGW. We need both versions so we can build Windows binaries for both.
+OS X Lion (or later) doesn't ship with an LLVM free gcc, which you will need in order to install ruby 1.8.7. We can install it with:
+ brew install
+ export CC=gcc-4.2
+For more info see:
Now we need to set up [rake-compiler](
-We'll start by installing some rubies.
+First, set the `CC` variable to your mingw32-gcc, for example:
-Make sure you have openssl installed first.
+ export CC=/usr/local/mingw/bin/i686-w64-mingw32-gcc
- brew install openssl
+Now, let's install some rubies:
# 1.8.7
rvm install 1.8.7-p352
@@ -200,14 +213,14 @@ Make sure you have openssl installed first.
rake-compiler cross-ruby VERSION=1.8.7-p352
# 1.9.3
- rvm install 1.9.3-p0
- rvm use 1.9.3-p0
+ rvm install 1.9.3-p125
+ rvm use 1.9.3-p125
rvm gemset create cucumber
rvm gemset use cucumber
gem install bundler
bundle install
- rake-compiler cross-ruby VERSION=1.9.3-p0
+ rake-compiler cross-ruby VERSION=1.9.3-p125
Now you can build Windows gems:
@@ -52,7 +52,7 @@ do |s|
s.files += Dir['lib/gherkin/rb_lexer/*.rb']
s.files += Dir['ext/**/*.c']
s.extensions = Dir['ext/**/extconf.rb']
- s.add_development_dependency('rake-compiler', '>= 0.7.9')
+ s.add_development_dependency('rake-compiler', '>= 0.8.0')
s.files -= Dir['**/.gitignore']
@@ -15,7 +15,8 @@ namespace :ikvm do
def mono(args)
if(`which mono`.strip =~ /mono/)
- sh("mono #{args}")
+ #
+ sh("mono --runtime=v4.0.30319 #{args}")
raise "[ERROR] You must install Mono and IKVM build gherkin for .NET. See"
@@ -26,7 +27,7 @@ namespace :ikvm do
mono("#{IKVMC_EXE} #{args}")
rescue => e
if e.message =~ /Cannot open assembly/
- e.message << "\n\n[ERROR] You must install Mono and IKVM build gherkin for .NET. See README.rdoc"
+ e.message << "\n\n[ERROR] You must install Mono and IKVM build gherkin for .NET. See"
raise e

0 comments on commit ac817b3

Please sign in to comment.