1

I installed ruby186-27_rc2 and i am getting the same error as described in the Ruby: Cannot Install Watir Gem On Windows thread when i try to install watir using gem install watir. Please see the error below.

C:\DevKit>gem install watir
Building native extensions.  This could take a while...
ERROR:  Error installing watir:
        ERROR: Failed to build gem native extension.

C:/Ruby/bin/ruby.exe extconf.rb
checking for strncpy_s()... no
creating Makefile.....

And then tried to install the devkit as suggested in the thread mentioned above. During the devkit installation i came up with a problem.

In step4 of devkit installation as described at Development Kit wiki i have added the path C:\Ruby to the config file and then ran the command ruby dk.rb install and i got the following error. Please help! Waiting for your inputs. Thanks!

C:/Ruby/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 15, col -1: `'
(ArgumentError)
        from C:/Ruby/lib/ruby/1.8/yaml.rb:133:in `load'
        from dk.rb:151:in `review'
        from dk.rb:143:in `open'
        from dk.rb:143:in `review'
        from dk.rb:248:in `send'
        from dk.rb:248:in `run'
        from dk.rb:262
Community
  • 1
  • 1
sridhar249
  • 4,471
  • 6
  • 26
  • 27
  • 1
    Well, the error message says `syntax error on line 15` of yaml.rb. Please add that line to your question. – Željko Filipin Dec 31 '10 at 09:28
  • @Željko Filipin: No, it says `syntax error on line 15` *from* `yaml.rb`. The syntax error is in the `config.yml` file that `dk.rb` is trying to load. – Jörg W Mittag Dec 31 '10 at 12:06
  • Please, if you need to add more details to your question, you should [edit](http://stackoverflow.com/posts/4568423/edit) your question, not answer it. Answers are for answering, its how the website works. Also, before you add, realize that throwing everything into your question will probably not help. Add relevant information and things that people are asking about, such as the relevant lines where the syntax error is happening. –  Jan 01 '11 at 02:33

1 Answers1

0

The DevKit contains a development environment for the MinGW port of MRI and YARV. You are using the MSVC6 port of MRI, so you need to install a development environment for MSVC6.

Unfortunately, there is no ready-made DevKit-like package for that. You will have to install it on your own. Note that it's not actually that hard to install, the biggest problem is to get a hold of a copy of Microsoft Visual C 6.0, since that hasn't been on sale for about 10 years now. You'll basically have to find someone who is going to sell you a used copy.

May I ask why you need to use a port of Ruby that hasn't been maintained in over 2 years, contains a version of Ruby that is so old that it cannot even run most modern code (e.g. Rails requires at least 1.8.7 or 1.9.2) and has several bugs, including security holes? Why don't you just use the MinGW port which is actually maintained?

This is all independent of the actual problem, of course, which is that you have a syntax error in your config.yml: you missed a dash and a space on line 15, which should read

- C:/Ruby

as indicated in the example section directly above it.

Jörg W Mittag
  • 363,080
  • 75
  • 446
  • 653
  • Actually i don't know about these ports that you are talking about. All i need to do is test my web application using watir. you said .."Why don't you just use the MinGW port which is actually maintained?"....can you please tell me how to use the MinGW port? – sridhar249 Dec 31 '10 at 21:31
  • @sridhar: The MinGW port is pretty much the only Windows port you can find nowadays. I am kind of amazed by the fact that you even managed to get a hold of that MSVC6 port, which has been obsolete for *years*. Anyways, you can find the MinGW port on the official Ruby website under http://Ruby-Lang.Org/en/downloads/ or on its own website http://RubyInstaller.Org/ . – Jörg W Mittag Dec 31 '10 at 22:00