0

I am trying to make an app using Rails 3 with Mongodb.I inserted two gem (i.e-gem 'mongoid', '~> 3.0.1' and gem 'bson_ext' ) and when run bundle install,I got the following error.

Error1:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    C:/Ruby193/bin/ruby.exe -r ./siteconf20150509-6132-1esd4mr.rb extconf.rb
checking for asprintf()... no
checking for ruby/st.h... yes
checking for ruby/regex.h... yes
checking for ruby/encoding.h... yes
creating Makefile

make  clean
Makefile:165: *** target pattern contains no `%'.  Stop.

make
Makefile:165: *** target pattern contains no `%'.  Stop.

make failed, exit code 2

Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/bson_ext-
1.12.1 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/bs
on_ext-1.12.1/gem_make.out
An error occurred while installing bson_ext (1.12.1), and Bundler cannot
continue.
Make sure that `gem install bson_ext -v '1.12.1'` succeeds before bundling.

As per the instruction is given above again I run gem install bson_ext -v '1.12.1' but i got the following error.

Error2:

ERROR:  Error installing bson_ext:
        ERROR: Failed to build gem native extension.

    C:/Ruby193/bin/ruby.exe -r ./siteconf20150509-1744-1n5pchu.rb extconf.rb
checking for asprintf()... no
checking for ruby/st.h... yes
checking for ruby/regex.h... yes
checking for ruby/encoding.h... yes
creating Makefile

make  clean
Makefile:165: *** target pattern contains no `%'.  Stop.

make
Makefile:165: *** target pattern contains no `%'.  Stop.

make failed, exit code 2

Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/bson_ext-
1.12.1 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/bs
on_ext-1.12.1/gem_make.out

Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.19'

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

gem 'sqlite3'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'
gem 'mongoid', '~> 3.0.1'
gem 'bson_ext'

Please help me to resolve this error.

satya
  • 3,508
  • 11
  • 50
  • 130
  • Look into this answer and follow all instructions http://stackoverflow.com/questions/26092541/windows-rails-error-installing-bson-ext/26370764#26370764 – rick May 09 '15 at 06:17

1 Answers1

0
gem install bson_ext -v 1.10.2
Soatl
  • 10,224
  • 28
  • 95
  • 153
Rebel Rider
  • 165
  • 16