1

I am newbie to ruby on rails, here i am trying to install ruby on rails on windows 7 64 bit. i installed the ruby installer and i installed rails. and also i created new app files. but when i start the rails server it is showing the following errors.

How can i get rid of these errors and start developing my ruby application?

C:\Users\walnut\Desktop > bundle install
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies.................
Using rake 10.4.2
Using i18n 0.7.0
Installing json 1.8.3 with native extensions

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.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.

C:\Users\walnut\Desktop > rails s
Could not find gem 'mysql2 (>= 0) x64-mingw32' in any of the gem sources listed
in your Gemfile or available on this machine.
Run `bundle install` to install missing gems.

C:\Users\walnut\Desktop > gem install mysql2
Fetching: mysql2-0.3.19.gem (100%)
ERROR:  Error installing mysql2:
        The 'mysql2' 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'

C:\Users\walnut\Desktop > rails s
Could not find gem 'mysql2 (>= 0) x64-mingw32' in any of the gem sources listed
in your Gemfile or available on this machine.
Run `bundle install` to install missing gems.
CJAY
  • 6,989
  • 18
  • 64
  • 106

4 Answers4

7

From here,

Follow the Instructions from the Ruby Installer Developer Kit Wiki:

  1. Download DevKit file from rubyinstaller.org
  2. Extract DevKit to path C:\RubyXXX\DevKit
  3. Run cd C:\RubyXXX\DevKit
  4. Run ruby dk.rb init
  5. Run ruby dk.rb review
  6. Run ruby dk.rb install
Community
  • 1
  • 1
Julli
  • 103
  • 1
  • 3
0

Where did you create your application? If you look at your command line, you are in your Desktop. You need to switch directories to your project folder to be in the right context.

Additionally, you need to install build tools to install json native extensions.

Please refer to/follow instructions from this other stack overflow answer - The 'json' native gem requires installed build tools.

Community
  • 1
  • 1
PressingOnAlways
  • 11,948
  • 6
  • 32
  • 59
0

As the error suggest you have to update your PATH to include build tools also known as DevKit.

If you have used RailsInstaller to install ruby on rails on your computer then it has already included in your rails installation directory. All you have to do now is to update your PATH to include it. See step 4 of instruction in DevKit Overview on Github.

If not follow above instruction to install DevKit and then get to work.

Loqman
  • 1,487
  • 1
  • 12
  • 24
0

Try follow this step and one more thing, if you use x64 of ruby installer, then please use x64 devkit. Same applied to x86. I'm facing this issues and the link gave it(step to install) to you save my time. Hope this helped.

p/s : if i'm correct in windows, ruby v2.2 above was't support higher nokogiri, to get things working properly use either ruby v1.9.3 or v2.1.6.

Check this link also for nokogiri supported.

Community
  • 1
  • 1
Norlihazmey Ghazali
  • 9,000
  • 1
  • 23
  • 40