2015-05-09 64 views
0

我想用Mongodb.I插入兩個gem(ie-gem'mongoid','〜> 3.0.1'和gem'bson_ext '),當運行bundle install時,我得到以下錯誤。在Rails 3中獲取Gem :: Ext :: BuildError 3

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. 

按照該指令被上面給出我再次運行gem install bson_ext -v '1.12.1',但我得到了下面的錯誤。

誤差2:

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' 

請幫我解決這個錯誤。

+0

看看這個答案,並遵守所有的指示http://stackoverflow.com/questions/26092541/windows-rails-error-installing-bson-ext/26370764#26370764 – rick

回答

0
gem install bson_ext -v 1.10.2