gem install json -v 1.7.3 gives 'Please update your PATH to include build tools'

Ruby on-Rails-3JsonWindows 8Build Tools

Ruby on-Rails-3 Problem Overview


When I run:

rails new blog

I get:

Installing json (1.7.3)
Gem::InstallError: The 'json' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
An error occurred while installing json (1.7.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.3'` succeeds before bundling.

When I run:

gem install json -v 1.7.3

I get:

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

I'm using Windows 8. I do have c:\ruby193\bin in my path. What do I do to remedy these errors?

Ruby on-Rails-3 Solutions


Solution 1 - Ruby on-Rails-3

Make sure you install the devkit (ticking the checkboxes that will update the path) : You might need to reinstall ruby too.

Install the DevKit

Download Development Kit from here http://rubyinstaller.org/downloads/

DevKit url at this time For use with Ruby 1.8.7 and 1.9.3: DevKit-tdm-32-4.5.2

For use with Ruby 2.0 and above (32bits version only): DevKit-mingw64-32-4.7.2

For use with Ruby 2.0 and above (x64 - 64bits only) DevKit-mingw64-64-4.7.2

Follow instructions here.

Or short instructions :

> Unzip the zip > > open command-line and go to unzipped folder > > ruby dk.rb init > > ruby dk.rb install > > gem install rdiscount --platform=ruby

Solution 2 - Ruby on-Rails-3

sometimes when you run the ruby dk.rb init you got an error like this

Ruby Error

for fixing this problem you have to change the encoding of the command prompt windows . to do this type chcp 1256 and you will receive this message : Active code page: 1256

now you can run that command without problem .

good luck .

Solution 3 - Ruby on-Rails-3

If you know that you have the proper DevKit installed (eg: via chocolatey), then you simply need to run the included script to set up environment variables.

In cmd:

C:\> d:\path\to\DevKit2\devkitvars.bat

In PowerShell:

PS> . d:\path\to\DevKit2\devkitvars.ps1

These scripts will set up the correct paths in your current command window.

Solution 4 - Ruby on-Rails-3

DevKit url at this time For use with Ruby 1.8.7 and 1.9.3: https://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe

For use with Ruby 2.0 and above (32bits version only): http://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe2

For use with Ruby 2.0 and above (x64 - 64bits only) http://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe3

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJoeView Question on Stackoverflow
Solution 1 - Ruby on-Rails-3Julien PelletView Answer on Stackoverflow
Solution 2 - Ruby on-Rails-3M.R.SafariView Answer on Stackoverflow
Solution 3 - Ruby on-Rails-3Ryan BemroseView Answer on Stackoverflow
Solution 4 - Ruby on-Rails-3AakashView Answer on Stackoverflow