Ruby on rails Can';t在Windows7中安装Bluecloth 2.2.0 gem

Ruby on rails Can';t在Windows7中安装Bluecloth 2.2.0 gem,ruby-on-rails,gem,windows-7-x64,ruby-2.0,Ruby On Rails,Gem,Windows 7 X64,Ruby 2.0,运行bundle安装时出现以下错误 注意:我还尝试了gem安装bluecloth--platform=ruby,但遇到了相同的问题 Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. C:/Ruby200/bin/ruby.exe extconf.rb checking for srand()... yes checking for random()... no checking

运行
bundle安装时
出现以下错误

注意:我还尝试了
gem安装bluecloth--platform=ruby
,但遇到了相同的问题

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

C:/Ruby200/bin/ruby.exe extconf.rb 
checking for srand()... yes
checking for random()... no
checking for rand()... yes
checking for bzero() in string.h,strings.h... no
checking for strcasecmp()... yes
checking for strncasecmp()... yes
checking for mkdio.h... yes
checking for ruby/encoding.h... yes
creating extconf.h
creating Makefile

make "DESTDIR="
generating bluecloth_ext-i386-mingw32.def
compiling bluecloth.c
In file included from c:\devkit\mingw\bin\../lib/gcc/i686-w64-     mingw32/4.7.2/../../../../i686-w64-mingw32/include/windows.h:59:0,
             from c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/winsock2.h:23,
             from c:/Ruby200/include/ruby-2.0.0/ruby/win32.h:40,
             from c:/Ruby200/include/ruby-2.0.0/ruby/defines.h:153,
             from c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h:70,
             from c:/Ruby200/include/ruby-2.0.0/ruby.h:33,
             from bluecloth.h:14,
             from bluecloth.c:25:
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/windef.h:113:23: error: duplicate 'unsigned'
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/windef.h:113:23: error: two or more data types in declaration specifiers
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/windef.h:114:24: error: duplicate 'unsigned'
c:\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-  mingw32/include/windef.h:115:23: error: duplicate 'unsigned'
make: *** [bluecloth.o] Error 1


Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/bluecloth-2.2.0    for inspection.
Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/bluecloth-2.2.0/ext/gem_make.out
An error occurred while installing bluecloth (2.2.0), and Bundler cannot
继续

在绑定之前,请确保
gem安装bluecloth-v'2.2.0'
成功

进程已完成,退出代码为5

Gemfile

source 'http://rubygems.org'
ruby "2.0.0"

## Bundle rails:
gem 'rails', '4.0.4'
 gem 'pg'
gem 'uglifier',     '>= 1.3.0'
gem 'sass-rails',   '~> 4.0.0'

gem 'actionpack-page_caching'
gem "activemerchant", '~> 1.29.3'#, :lib => 'active_merchant'
gem "american_date"

# Use https if you are pushing to HEROKU
##  NOTE: run the test before upgrading to the tagged version. It has had several deprecation warnings.
gem 'authlogic', github: 'binarylogic/authlogic', ref: 'e4b2990d6282f3f7b50249b4f639631aef68b939'
#gem 'authlogic',          "~> 3.3.0"

gem "asset_sync"
gem 'awesome_nested_set', '~> 3.0.0.rc.1'

gem 'aws-sdk'
gem 'bluecloth',      '~> 2.2.0'
gem 'cancan',         '~> 1.6.8'
gem 'chronic'
# Use https if you are pushing to HEROKU
gem 'compass-rails', git: 'https://github.com/Compass/compass-rails.git'
#gem 'compass-rails',  git: 'git://github.com/Compass/compass-rails.git'


gem 'dynamic_form'
gem 'jbuilder'
gem "friendly_id",    '~> 5.0.1'#, :git => "git@github.com:FriendlyId/friendly_id.git", :branch => 'rails4'
gem "jquery-rails"
gem 'jquery-ui-rails'
gem 'json',           '~> 1.8.0'

#gem "nifty-generators", :git => 'git://github.com/drhenner/nifty-generators.git'
gem 'nokogiri',     '~> 1.6.0'
gem 'paperclip',    '~> 3.0'
gem 'prawn',        '~> 0.12.0'

gem "rails3-generators", "~> 1.0.0"
#git: "https://github.com/neocoin/rails3-generators.git"
gem "rails_config"
gem 'rmagick',    :require => 'RMagick'

gem 'rake', '~> 10.1'

# gem 'resque', require: 'resque/server'

gem 'state_machine', '~> 1.2.0'
#gem 'sunspot_solr', '~> 2.0.0'
#gem 'sunspot_rails', '~> 2.0.0'
gem 'will_paginate', '~> 3.0.4'
gem 'zurb-foundation', '~> 4.3.2'

group :production do
  #gem 'mysql2', '~> 0.3.12'
  gem 'rails_12factor'
end

group :development do
  #gem 'sqlite3'

  gem 'railroady'
  #gem 'awesome_print'
  #gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git'
  gem "autotest-rails-pure"
  gem "better_errors", '~> 0.9.0'
  gem "binding_of_caller", '~> 0.7.2'
  gem 'debugger'#, '~> 1.6.1'
  gem "rails-erd"

  # YARD AND REDCLOTH are for generating yardocs
  gem 'yard'
  gem 'RedCloth'
end
group :test, :development do
  gem 'capybara', "~> 1.1"#, :git => 'git://github.com/jnicklas/capybara.git'
  gem 'launchy'
  gem 'database_cleaner', "~> 1.2"
end

group :test do
  gem 'factory_girl', "~> 3.3.0"
  gem 'factory_girl_rails', "~> 3.3.0"
  gem 'mocha', '~> 0.13.3', :require => false
  gem 'rspec-rails-mocha'
  gem 'rspec-rails', '~> 2.12.2'

  gem 'email_spec'
  gem "faker"

end
它重复:

我试过了,效果很好:

如果您需要2.2.0(最新版本),以下是我如何让它工作的:

安装DevKit

运行以下命令以安装bluecloth:

宝石蓝布

这将在构建“本机扩展”时失败,但将成功安装gem的源代码

修补程序bluecloth.h文件(对我来说,可以在:D:\ruby\ruby-1.9.3-p125\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\ext中找到),修补程序如下:

转到bluecloth的gem安装文件夹。对我来说,这如下所示:

D:\ruby\ruby-1.9.3-p125\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0

运行以下命令:

耙宝石

它可能会提示您安装一些其他gems,请按照相应的步骤操作。完成后,您应该会看到创建了一个bluecloth-2.2.0.gem。对我来说,可以在这里找到:

D:\ruby\ruby-1.9.3-p125\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\pkg\bluecloth-2.2.0.gem

转到bluecloth-2.2.0.gem位置,并运行以下命令:

gem安装bluecloth-2.2.0.gem--platform=ruby