Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 658
Joe Avatar asked May 22 '12 02:05

Joe


People also ask

How do I install a gem file?

run the command bundle install in your shell, once you have your Gemfile created. This command will look your Gemfile and install the relevant Gems on the indicated versions. The Gemfiles are installed because in your Gemfile you are pointing out the source where the gems can be downloaded from.

How do I install a specific version of a ruby gem?

Use `gem install -v` You may already be familiar with gem install , but if you add the -v flag, you can specify the version of the gem to install. Using -v you can specify an exact version or use version comparators.

What is JSON Ruby gem?

Learn about our Editorial Process. Updated on February 06, 2019. It's easy to jump into parsing and generating JSON in Ruby with the json gem. It provides an API for parsing JSON from text as well as generating JSON text from arbitrary Ruby objects. It's easily the most used JSON library in Ruby.


2 Answers

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

like image 182
Julien Pellet Avatar answered Oct 21 '22 23:10

Julien Pellet


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 .

like image 39
M.R.Safari Avatar answered Oct 22 '22 01:10

M.R.Safari