The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

normal (2) [Avatar] Offline
#1
Hello,

I have installed Ruby 1.9.2 and Rails 3.1.1

I'm in the section 3.1.3 of the book, "The Gemfile and generators"

I've changed gemfile as described in the book for installing RSpec, Cucumber and Capybara, and then run "bundle install --binstubs".

I get this output:

Fetching source index for http://rubygems.org/
Using rake (0.9.2.2)
Using multi_json (1.0.4)
Using activesupport (3.1.1)
Using builder (3.0.0)
Using i18n (0.6.0)
Using activemodel (3.1.1)
Using erubis (2.7.0)
Using rack (1.3.6)
Using rack-cache (1.1)
Using rack-mount (0.8.3)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.0.3)
Using actionpack (3.1.1)
Using mime-types (1.17.2)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.3.0)
Using actionmailer (3.1.1)
Using arel (2.2.1)
Using tzinfo (0.3.31)
Using activerecord (3.1.1)
Using activeresource (3.1.1)
Using bundler (1.0.21)
Using nokogiri (1.5.0)
Installing ffi (1.0.11) with native extensions

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.

C:/RailsInstaller/Ruby1.9.2/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


Gem files will remain installed in C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9
.1/gems/ffi-1.0.11 for inspection.
Results logged to C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/ffi-1.0.1
1/ext/ffi_c/gem_make.out
An error occured while installing ffi (1.0.11), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.0.11'` succeeds before bundling.


I Try to run "gem install ffi -v '1.0.11'", but i get the same error.

Anyone had the same problem?
normal (2) [Avatar] Offline
#2
Solved
I solved the problem by installing ffi 1.0.9 instead of let the system to install 1.0.11.

To achieve this I write this line in the gemfile:

gem 'ffi', '1.0.9'

This solution is explained here:
http://stackoverflow.com/questions/7852566/error-error-installing-ffi-error-failed-to-build-gem-native-extension
ryanbigg (423) [Avatar] Offline
#3
Re: Solved
Thanks for researching a solution + posting what you found. This'll probably help someone else too smilie