I just spent quite a bit of time trying to get Buildr to work on Ruby. I started with 1.9 but that did not work. All my team was using 1.8.7, but on Mac.
So I started down the 1.8.7 path, then I found the standard Gem did not work for Ruby 1.8.7 on Windows XP.
Then I tried to build the gem from source:
- Get the latest: http://github.com/apache/buildr/zipball/trunk
- cd into buildr directory “gem build buildr.gemspec”
- gem install buildr -v 1.4.1
But I was getting this error:
C:\temp\Downloads\apache-buildr-d6f197f>gem install buildr -v 1.4.1 --platform x86-mswin32-80
Building native extensions. This could take a while...
ERROR: Error installing buildr:
ERROR: Failed to build gem native extension.
C:/usr/bin/Ruby187/bin/ruby.exe extconf.rb
checking for jni.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/usr/bin/Ruby187/bin/ruby
Gem files will remain installed in C:/usr/bin/Ruby187/lib/ruby/gems/1.8/gems/rjb-1.2.5 for inspection.
Results logged to C:/usr/bin/Ruby187/lib/ruby/gems/1.8/gems/rjb-1.2.5/ext/gem_make.out
C:\temp\Downloads\apache-buildr-d6f197f>gem install buildr -v 1.4.1 --platform x86-mswin32-80Building native extensions. This could take a while...ERROR: Error installing buildr: ERROR: Failed to build gem native extension.
C:/usr/bin/Ruby187/bin/ruby.exe extconf.rbchecking for jni.h... no*** extconf.rb failed ***Could not create Makefile due to some reason, probably lack ofnecessary libraries and/or headers. Check the mkmf.log file for moredetails. You may need configuration options.
Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=C:/usr/bin/Ruby187/bin/ruby
Gem files will remain installed in C:/usr/bin/Ruby187/lib/ruby/gems/1.8/gems/rjb-1.2.5 for inspection.Results logged to C:/usr/bin/Ruby187/lib/ruby/gems/1.8/gems/rjb-1.2.5/ext/gem_make.out
Then I came across this posting:
http://www.mail-archive.com/users@buildr.apache.org/msg00945.html
Gave me the missing peice:
1. Installing the Ruby one-click installer is not enough, you also need the devkit so you have a compiler and make. The devkit is a 7zip file available on the same page as the one-click installer. You just extract it to your Ruby directory and make sure the paths in devkit/msys/1.0.11/etc/fstab are accurate.
Then I ran the buildr help command to ensure this was working
C:\temp\Downloads\apache-buildr-d6f197f>buildr help
(in C:/temp/Downloads/apache-buildr-d6f197f, development)
Usage:
buildr [-f rakefile] {options} targets...
Common tasks:
artifacts # Download all artifacts
artifacts:sources # Download all artifacts' sources
build # Build the project
cc # Execute continuous compilation, listening to changes
clean # Clean files generated during a build
clobber # Clean up all temporary directories used for running tests, creating documentation, packaging, etc.
compile # Compile all projects
default # The default task is build
doc # Create the documentation for this project
eclipse # Generate Eclipse artifacts for all projects
help:projects # List all projects defined by this buildfile
help:tasks # List all tasks available from this buildfile
idea # Generate Idea artifacts for all projects
idea7x # Generate Idea 7.x artifacts for all projects
idea7x:clean # Delete the generated Idea 7.x artifacts for all projects
install # Install packages created by the project
junit:report # Generate JUnit tests report in reports/junit
package # Create packages
release # Make a release
test # Run all tests
test:failed # Run failed tests
uninstall # Remove previously installed packages
upload # Upload packages created by the project
For help on command line options:
buildr --help
Downloading org.apache.ant:ant:jar:1.8.0
Buildr aborted!
RuntimeError : Unable to download org.apache.ant:ant:jar:1.8.0. No remote repositories defined.
(See full trace by running task with --trace)
This was able to get me to run buildr, but now I get another error:
C:\svn_workspaces\xIVR\agent-ivr\trunk>buildr -vt install (in C:/svn_workspaces/xIVR/agent-ivr/trunk, development) ** Invoke C:/temp/repository/org/springframework/spring-aop/3.0.2.RELEASE/spring-aop-3.0.2.RELEASE.pom (first_time) ** Execute C:/temp/repository/org/springframework/spring-aop/3.0.2.RELEASE/spring-aop-3.0.2.RELEASE.pom Downloading org.springframework:spring-aop:pom:3.0.2.RELEASE Downloading org.springframework:spring-aop:pom:3.0.2.RELEASE Buildr aborted! RuntimeError : Unable to download org.springframework:spring-aop:pom:3.0.2.RELEASE. No remote repositories defined.
So then I reverted back to buildr 1.3.5, uninstalling 1.4.1 first, then followed the above steps again.
I hate to say RTFM because there is just so much to read, but, there you go!.

