I have been using Windows (XP) for developing rails (version 3.2) via an upgraded version of Instant Rails.

Installing json gem for Rails on Windows

When I changed my machine (Windows 7), I was forced to used bundle install again and found out an issue on installing one of the gems, specifically json.

Entering install gem json, still creates an error.

'make' is not recognized as internal or external command

Reading the logs, I was informed that make is an unavailable command. Actually, windows does not support the make command at all.

In this case, we would need to install a devkit for the said command. You may need to download the devkit files and install it.

The devkit files

  1. Extract the zip files inside a directory

  2. Add the [devkit-directory]/bin in your %PATH% in the environment variables

  3. Add also your ruby directory (in my case is within the Instant Rails directory) in the said %PATH%

    This is required to configure your devkit, else the system would look for other missing commands such as gcc.exe

    Installing json gem for Rails on Windows

  4. Now re-run all your consoles (cli)

  5. Re-run your bundle install command


That should do the trick.

Troubleshoot -- make: gcc: Command not found

During the installation of the devkit, I encoutered the error regarding gcc. I was able to fixed it by configuring the devkit properly.

  1. Go to the [devkit-directory]/bin

  2. Run the following:
    ruby dk.rb init
    
    This will generate config.yml

  3. Open config.yml and add your ruby directory.

  4. Run the following command:
    ruby dk.rb install
    

  5. Restart all CLI

3 comments :

  1. installing Rails and other gems on Windows platform, IMO is nightmare.
    IMHO,better to switch to Linux based platform if you want to run a Rails app.
    If you need a Windows , you can have it on virtual box or as dual-OS on your box.


    Kevin

    ReplyDelete
  2. yeah I know.. windows and rails is such a painful combination.. but sometimes you just have to deal with the available resources right ;)

    ReplyDelete
  3. yeah , and that's what I mean with "nightmare"

    ReplyDelete