在Windows上安装捆绑包时出错

时间:2011-11-22 22:05:52

标签: ruby-on-rails ruby gem bundle

当我尝试运行bundle install时,我收到了这个错误:

    Installing hiredis (0.3.2) with native extensions 
    Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    C:/RailsInstaller/Ruby1.9.2/bin/ruby.exe extconf.rb 
    gcc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings    -g -ggdb  net.c
    net.c:1:0: warning: -fPIC ignored for target (all code is position independent)
    net.c:35:24: fatal error: sys/socket.h: No such file or directory
    compilation terminated.
    make: *** [net.o] Error 1
    creating Makefile

    make
    C:/RailsInstaller/Ruby1.9.2/bin/ruby -e "puts 'EXPORTS', 'Init_hiredis_ext'"  > hiredis_ext-i386-mingw32.def
    gcc -I. -IC:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/i386-mingw32 -I/C/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/backward -I/C/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1 -I.   -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -IC:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/hiredis-0.3.2/vendor/hiredis  -o connection.o -c connection.c
    connection.c:1:24: fatal error: sys/socket.h: No such file or directory
    compilation terminated.
    make: *** [connection.o] Error 1


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

    Process finished with exit code 5

我的宝石文件是:

来源'http://rubygems.org'

gem 'rails', '3.1.1'

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

gem 'sqlite3'
gem "rake", "0.8.7"
gem "mysql"

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.1.4'
  gem 'coffee-rails', '~> 3.1.1'
  gem 'uglifier', '>= 1.0.3'
end

gem 'devise'

gem 'execjs'
gem 'therubyracer'

gem 'jquery-rails', '>= 1.0.12'
gem 'faye'

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

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

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

group :test do
  # Pretty printed test output
  gem 'turn', :require => false
end

2 个答案:

答案 0 :(得分:6)

Hiredis 在Windows上运行。有几个建议的补丁将修复它,但没有一个被批准:

答案 1 :(得分:0)

您可能需要这样做:

gem install hiredis -v '0.3.2'

然后运行

bundle install

通常在捆绑错误时,因为你需要安装一个宝石,如果你搜索哪个宝石丢失,通常会在那里说。