我试图在Windows 8.1计算机上运行rails应用程序,但我需要json gem version 1.8.1。我目前有json 1.7.7。 Bundle install会返回一个错误,并要求我确保" gem install json -v 1.8.1"成功。运行该命令返回
E:\rails_projects\bookit>gem install json -v 1.8.2
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
C:/Ruby200-x64/bin/ruby.exe -r ./siteconf20150212-3852-vjuo23.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
generating generator-x64-mingw32.def
compiling generator.c
make: x86_64-w64-mingw32-gcc: Command not found
make: *** [generator.o] Error 127
make failed, exit code 2
Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/json-
1.8.2 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/extensions/x64-mingw32/2.0.
0/json-1.8.2/gem_make.out
E:\rails_projects\bookit>
我将DevKit路径添加到我的环境变量列表中。我觉得奇怪的是我遇到了DevKit的问题,因为green_shoes安装并且工作正常,它需要DevKit。我错过了什么?
注意: 我正在使用Ruby 2.0.0,64位,以及rubyinstaller.org推荐的相应DevKit
编辑:我的rails应用程序的Gemfile 来源' https://rubygems.org' ruby' 2.0.0'
gem 'rails', '4.1.4'
gem 'bootstrap-sass', '2.3.2.0'
gem 'sprockets', '2.11.0'
gem 'bcrypt-ruby', '3.1.2'
gem 'will_paginate', '3.0.4'
gem 'bootstrap-will_paginate', '0.0.9'
gem 'barista'
gem 'jquery-rails'
group :development, :test do
gem 'sqlite3'
gem 'rspec-rails', '2.14.0'
end
group :test do
gem 'selenium-webdriver', '2.35.1'
gem 'capybara', '2.1.0'
gem 'factory_girl_rails', '4.2.0'
end
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
https://github.com/rails/turbolinks
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
group :doc do
gem 'sdoc', '~> 0.4.0', require: false
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor', '0.0.2'
end
答案 0 :(得分:0)
这是你的错误:
make: x86_64-w64-mingw32-gcc: Command not found
-
导致错误的原因是您的计算机上找不到gcc/gc++ compiler
。
您应该refer to this page了解更多相关信息。
您应该download this build kit,安装它,然后运行以下内容:
set PATH=c:/path/to/your/mingw64/installation;%PATH%
然后再次执行构建 - 它应该可以工作。