Bundler not working on windows for gems that are extensions

When installing gems that are c extensions using regular gem install, it works but when using gem bundle, it doesn’t. Below is the session that shows this. I tried this with json also

C:\Documents and Settings\dominic e sisneros\My Documents\programming\sinatra\facility>ruby -v

ruby 1.8.6 (2009-08-04 patchlevel 383) [i386-mingw32]

C:\Documents and Settings\dominic e sisneros\My Documents\programming\sinatra\facility>gem environment
RubyGems Environment:

  • RUBYGEMS VERSION: 1.3.5

  • RUBY VERSION: 1.8.6 (2009-08-04 patchlevel 383) [i386-mingw32]

  • INSTALLATION DIRECTORY: C:/ruby/lib/ruby/gems/1.8

  • RUBY EXECUTABLE: C:/ruby/bin/ruby.exe

  • EXECUTABLE DIRECTORY: C:/ruby/bin

  • RUBYGEMS PLATFORMS:

    • ruby
    • x86-mingw32
  • GEM PATHS:

    • C:/ruby/lib/ruby/gems/1.8
    • C:/Documents and Settings/dominic e sisneros/My Documents/.gem/ruby/1.8
  • GEM CONFIGURATION:

yinstaller.org"]

C:\Documents and Settings\dominic e sisneros\My Documents\programming\sinatra\facility>gem install bcrypt-ruby

Building native extensions. This could take a while…
Successfully installed bcrypt-ruby-2.1.2
1 gem installed
Installing ri documentation for bcrypt-ruby-2.1.2…
Installing RDoc documentation for bcrypt-ruby-2.1.2…

C:\Documents and Settings\dominic e sisneros\My Documents\programming\sinatra\facility>cat Gemfile
disable_rubygems
source “http://gemcutter.org
gem “bcrypt-ruby”

C:\Documents and Settings\dominic e sisneros\My Documents\programming\sinatra\facility>gem bundle
Calculating dependencies…
Updating source: http://gems.rubyforge.org

Updating source: http://gemcutter.org
Downloading bcrypt-ruby-2.1.2.gem
Installing bcrypt-ruby (2.1.2)
Building native extensions. This could take a while…
ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)

ERROR: Failed to build gem native extension.

C:/ruby/bin/ruby.exe extconf.rb
creating Makefile

make
Makefile:123: warning: overriding commands for target C:/Documents' Makefile:117: warning: ignoring old commands for target C:/Documents’

Makefile:123: warning: overriding commands for target and' Makefile:117: warning: ignoring old commands for target and’
Makefile:123: warning: overriding commands for target Settings/dominic' Makefile:117: warning: ignoring old commands for target Settings/dominic’

Makefile:123: warning: overriding commands for target e' Makefile:117: warning: ignoring old commands for target e’
Makefile:123: warning: overriding commands for target sisneros/My' Makefile:117: warning: ignoring old commands for target sisneros/My’

gcc -Wall -I. -I/C/ruby/lib/ruby/1.8/i386-mingw32 -I/C/ruby/lib/ruby/1.8/i386-mingw32 -I. -g -O2 -c bcrypt.c
gcc -Wall -I. -I/C/ruby/lib/ruby/1.8/i386-mingw32 -I/C/ruby/lib/ruby/1.8/i386-mingw32 -I. -g -O2 -c bcrypt_ext.

c
gcc -Wall -I. -I/C/ruby/lib/ruby/1.8/i386-mingw32 -I/C/ruby/lib/ruby/1.8/i386-mingw32 -I. -g -O2 -c blowfish.c
gcc -shared -s -o bcrypt_ext.so bcrypt.o bcrypt_ext.o blowfish.o -L. -LC:/ruby/lib -L. -Wl,–enable-auto-image-ba

se,–enable-auto-import,–export-all -lmsvcrt-ruby18 -lshell32 -lws2_32

make install
Makefile:123: warning: overriding commands for target C:/Documents' Makefile:117: warning: ignoring old commands for target C:/Documents’

Makefile:123: warning: overriding commands for target and' Makefile:117: warning: ignoring old commands for target and’
Makefile:123: warning: overriding commands for target Settings/dominic' Makefile:117: warning: ignoring old commands for target Settings/dominic’

Makefile:123: warning: overriding commands for target e' Makefile:117: warning: ignoring old commands for target e’
Makefile:123: warning: overriding commands for target sisneros/My' Makefile:117: warning: ignoring old commands for target sisneros/My’

mkdir -p C:/Documents
mkdir -p and
mkdir -p Settings/dominic
mkdir -p e
mkdir -p sisneros/My
mkdir -p Documents/programming/sinatra/facility/vendor/gems/gems/bcrypt-ruby-2.1.2/lib
/bin/install -c -m 0755 bcrypt_ext.so C:/Documents and Settings/dominic e sisneros/My Documents/programming/sinatra

/facility/vendor/gems/gems/bcrypt-ruby-2.1.2/lib
/bin/install: omitting directory C:/Documents' /bin/install: omitting directory and’
/bin/install: omitting directory Settings/dominic' /bin/install: omitting directory e’

/bin/install: omitting directory `sisneros/My’
make: *** [Documents/programming/sinatra/facility/vendor/gems/gems/bcrypt-ruby-2.1.2/lib/bcrypt_ext.so] Error 1

Gem files will remain installed in C:/Documents and Settings/dominic e sisneros/My Documents/programming/sinatra/fa

cility/vendor/gems/gems/bcrypt-ruby-2.1.2 for inspection.
Results logged to C:/Documents and Settings/dominic e sisneros/My Documents/programming/sinatra/facility/vendor/gem
s/gems/bcrypt-ruby-2.1.2/ext/mri/gem_make.out

C:\Documents and Settings\dominic e sisneros\My Documents\programming\sinatra\facility>

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/104505
http://rubyforge.org/tracker/index.php?func=detail&aid=17911&group_id=426&atid=1700

Apparently, there's a long-standing difficulty with mkmf and Windows paths that contain spaces. Can you try again from a directory without spaces in the path?

--Matt Jones

You are right. It worked on a path without spaces! I will post this to the rubyinstaller mailing list.