carlhuda/bundler — Issue #1493: unable to install gem ffi on window 7 in rails 3 app
Author: doel
Created: 2011-10-21 11:13:24+00:00
State: open

Hi I am using bundle 1.1.

I have the follwoing gems in my Gemfile

source 'http://rubygems.org'

#gem 'rails', '3.1'
gem 'rails', '3.0.9'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'mysql'
gem "paperclip", "~> 2.3"
gem "scaffoldhub"
gem "rack"
gem "haml"
gem "rake", "~> 0.9.2"
gem "gmaps4rails", "~> 0.9.1"
gem 'will_paginate', '3.0.pre2' # still not release for Rails 3

group :development, :test do
gem "rspec-rails", "2.0.1"
gem "factory_girl_rails", "~> 1.1.rc1"
#gem 'cucumber-rails'
#gem 'database_cleaner'
gem 'capybara'
end

But whenever I am trying to execute bundle install, its throwing me the following error.
I have configured Devkit in my machine, in order to build gems with native extensions on windows, but its not helping.

Installing ffi (1.0.10) with native extensions Unfortunately, a fatal error has occurred. Please rep
ort this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we
can fix it. Thanks!
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:529:in `rescue in block in build_extension
s': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

C:/Ruby192/bin/ruby.exe extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include... no
checking for rb_thread_blocking_region()... yes
checking for ruby_thread_has_gvl_p()... yes
checking for ruby_native_thread_p()... yes
checking for rb_thread_call_with_gvl()... yes
creating extconf.h
creating Makefile

make
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/include/ruby-1.9.1/ruby/backward -
I/C/Ruby192/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -O3 -g -Wextra -Wno-unused-para
meter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-lon
g -Wno-declaration-after-statement -o AbstractMemory.o -c AbstractMemory.c
In file included from AbstractMemory.c:28:0:
compat.h:65:20: warning: extra tokens at end of #ifndef directive
compat.h:69:24: warning: extra tokens at end of #ifndef directive
In file included from AbstractMemory.h:29:0,
from AbstractMemory.c:29:
Types.h:68:17: fatal error: ffi.h: No such file or directory
compilation terminated.
make: *** [AbstractMemory.o] Error 1

Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/ffi-1.0.10 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/ffi-1.0.10/ext/ffi_c/gem_make.out
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:507:in `block in build_extens
ions'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `each'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `build_extensions'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:156:in `install'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.rc/lib/bundler/source.rb:90:in `block i
n install'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.rc/lib/bundler/rubygems_integration.rb:
78:in `preserve_paths'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.rc/lib/bundler/source.rb:89:in `install
'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.rc/lib/bundler/installer.rb:73:in `bloc
k in install_gem_from_spec'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.rc/lib/bundler/rubygems_integration.rb:
93:in `with_build_args'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.rc/lib/bundler/installer.rb:72:in `inst
all_gem_from_spec'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.rc/lib/bundler/installer.rb:56:in `bloc
k in run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.rc/lib/bundler/installer.rb:55:in `run'

from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.rc/lib/bundler/installer.rb:12:in `inst
all'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.rc/lib/bundler/cli.rb:219:in `install'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.rc/lib/bundler/vendor/thor/task.rb:22:i
n `run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.rc/lib/bundler/vendor/thor/invocation.r
b:118:in `invoke_task'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.rc/lib/bundler/vendor/thor.rb:263:in `d
ispatch'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.rc/lib/bundler/vendor/thor/base.rb:386:
in `start'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.rc/bin/bundle:13:in `'
from C:/Ruby192/bin/bundle:19:in `load'
from C:/Ruby192/bin/bundle:19:in `

'

Please help