1

I'm trying to run a rails app on my Windows 8.1 computer, but I need json gem version 1.8.1. I currently have json 1.7.7. Bundle install returns an error and asks for me to make sure "gem install json -v 1.8.1" succeeds. Running that command returns

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>

I added the DevKit path to my list of environment variables. I find it odd that I am having a problem with DevKit because green_shoes installs and works fine, and it requires DevKit. What am I missing?

Note: I am using Ruby 2.0.0, 64-bit, as well as the corresponding DevKit as recommended by rubyinstaller.org

EDIT: Gemfile for my rails app source '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
Shwheelz
  • 545
  • 3
  • 8
  • 22
  • fails to build gem native extension, recommends I install json 1.8.2 first – Shwheelz Feb 12 '15 at 19:00
  • does not look like you have json in your Gemfile – Joel Feb 12 '15 at 19:14
  • 1
    I mean, does it really matter if I have it in my Gemfile if 'gem install json -v 1.8.1' doesn't work? I added it to the Gemfile and ran 'bundle install' with the same error – Shwheelz Feb 12 '15 at 19:35
  • You might want to take a look a this http://stackoverflow.com/questions/16579019/rails-on-windows-install-issue – Ismael Abreu Feb 12 '15 at 19:46
  • I did a fresh install of Ruby and the DevKit and was able to update json. Now I have both 1.8.1 and 1.7.7 installed. Not sure if that's going to cause problems, but I'll post back if it does. As a side note, I've seen that post. I'm usually very careful with what I install, but I guess it's possible I clicked the wrong DevKit by mistake (as per that post). – Shwheelz Feb 12 '15 at 20:20

1 Answers1

0

This is your error:

make: x86_64-w64-mingw32-gcc: Command not found

--

The error is caused because the gcc/gc++ compiler is not found on your computer.

You should refer to this page for more information on this.

You should download this build kit, install it and then run the following:

set PATH=c:/path/to/your/mingw64/installation;%PATH%

Then perform the build again - it should work.

Richard Peck
  • 76,116
  • 9
  • 93
  • 147
  • Thanks for the response. I ended up manually installing an updated version of Rubygems and have both versions of the gem. It seems to be working, but maybe your response can help others with the same problem. – Shwheelz Mar 20 '15 at 21:46