small medium large xlarge

06 Aug 2012, 16:11
Victor Ch. (8 posts)

Hello. I Have an issue with code in chapter 12 (Testing any rest API) After i run the cucumber (pages 217-218) i have an error:


Full error log here: 

The system cannot find the file specified. (2) (ChildProcess::LaunchError)                          
7:in `create_process'
4:in `start'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/childprocess-0.3.4/lib/childprocess/windows/process.rb:63:in `la
d:/Ruby192/lib/ruby/gems/1.9.1/gems/childprocess-0.3.4/lib/childprocess/abstract_process.rb:67:in `s
d:/Work/tests/fruit/features/support/env.rb:6:in `<top (required)>'                                 
d:/Ruby192/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in `lo
d:/Ruby192/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in `lo
d:/Ruby192/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:171:in `load
d:/Ruby192/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:83:in `block
 in load_files!'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in `each'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in `load_
d:/Ruby192/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:175:in `load_step_definit
d:/Ruby192/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:40:in `run!'             
d:/Ruby192/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:43:in `execute!'        
d:/Ruby192/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:20:in `execute'         
d:/Ruby192/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/bin/cucumber:14:in `<top (required)>'            
d:/Ruby192/bin/cucumber:19:in `load'
d:/Ruby192/bin/cucumber:19:in `'>
06 Aug 2012, 16:30
Matt Wynne (87 posts)


I don’t have the book to hand, but I presume that line 6 of env.rb where the error is coming from is where it tries to run rackup, is that correct? Can you try running the same command manually from a command prompt?

07 Aug 2012, 06:30
Victor Ch. (8 posts)

Hi. Thank you for your responce. Yes, this line is : “server.start” it’s really starts ‘rackup’. I can manually run ‘rackup’ from my cmd. I did this a few pages before.

After some googling i find, that childprocess starts only Windows executables. And with this gem it fails.

07 Aug 2012, 10:52
Matt Wynne (87 posts)

This is odd, because it means that Childprocess can’t see the same set of commands that you can see from your cmd prompt.

RubyGems should automatically create a .bat wrapper script for each of these commands, so somewhere on your machine there will be a rackup.bat which is what you were able to run manually. I wonder why Childprocess can’t see it.

I guess this is something to do with paths. Is there anything unusual about your Ruby installation? Did you follow all the steps in the installation appendix chapter?

07 Aug 2012, 13:10
Victor Ch. (8 posts)

Yes, i have rackup.bat in my \bin dir of Ruby’s installation folder. And everythig is correct with %PATH% variable: i have this folder specified there.

And i’ve followed all the steps of Cucumber installation (first of all).

Mb, today, later, i try to launch this code at other PC, running same development enviroment. I’ll comment this topic after this.

07 Aug 2012, 14:39
Matt Wynne (87 posts)

Could you try changing the code to point to the full path to the rackup.bat file?

I’m hoping some other Windows users will chime in here, it’s been a while for me I’m afraid :)

07 Aug 2012, 21:37
Matt Wynne (87 posts)


The maintainer of the Ruby one-click installer suggests you try “ruby -S rackup” instead of just “rackup”

08 Aug 2012, 07:26
Victor Ch. (8 posts)

Hello again. I hope, i’ve found the source of the problem. First, i tried run “ruby -S rackup” in command line and got an error “configuration %WORKDOR%/ not found” “Ok”< i thought, and start digging deeper. Next I try to use “ruby -S rackup” in my code. And get again “The system cannot find the file specified” Next step was try to point to “rackup.bat” And I did it with Windows-style path: “D:\Ruby192\bin\rackup.bat”. And got “cannot find the file specified” again. After that i tried to use nix style path “D:/Ruby192/bin/rackup.bat”. And *this time was an “configuration %WORKDOR%/ not found” error. Yahoo! Seems like ruby interpreter can not correctly load “windows” paths.

I’ve made a tiny .rb script, which launches only rackup, to easier testing:

 require 'childprocess'

process ="D:\Ruby192\bin\rackup.bat")

And with it I get a bit another error:

 d:/Ruby192/lib/ruby/gems/1.9.1/gems/childprocess-0.3.4/lib/childprocess/windows/process_builder.rb:87:in `create_process':
        The system cannot find the file specified. (2) (ChildProcess::LaunchError)   
        from d:/Ruby192/lib/ruby/gems/1.9.1/gems/childprocess-0.3.4/lib/childprocess/windows/process_builder.rb:34:in `start'                                                                           
        from d:/Ruby192/lib/ruby/gems/1.9.1/gems/childprocess-0.3.4/lib/childprocess/windows/process.rb:63:in `launch_process'                                                                          
        from d:/Ruby192/lib/ruby/gems/1.9.1/gems/childprocess-0.3.4/lib/childprocess/abstract_process.rb:67:in `start'                                                                                  
        from test.rb:4:in `<main>'  

Seems like a bug in ruby.

And sorry for my English.

08 Aug 2012, 09:34
Jari Bakken (1 post)

Can you try that again, but escape the slashes in the path?“D:\Ruby192\bin\rackup.bat”)@

08 Aug 2012, 10:30
Victor Ch. (8 posts)

Escaping helps, ty, but i still got “ not found” error. This file is located in “Ruby192\lib\ruby\gems\1.9.1\gems\rack-1.4.1\test\rackup” folder.

tried to add this file as a custom require. Ruby can not load this file too (mb I do something wrong?)

08 Aug 2012, 12:02
Matt Wynne (87 posts)

If you’ve got the error about not found, then you’re getting somewhere, because that means you’re now running rackup.

Achievement unlocked!

I guess you now need to pass a full path to the file as well, as it seems rackup isn’t able to figure out your current working directory.

08 Aug 2012, 12:18
Victor Ch. (8 posts)

Yes, that’s right. I can solve this (later), and now greate thanks to everybody, who tried to help. And abig thanks for you, Matt, for this great book and fast response.

21 Aug 2012, 04:48
Sam Biggins (1 post)

To close the loop on this, I had the same issue and was able to fix it by changing the “server =” line to:

server ="C:\\RailsInstaller\\Ruby1.9.3\\bin\\ruby", "-S", "rackup", "--port", "9999")

Also, great book!

10 Jan 2013, 09:03
Rahul Panjiyar (6 posts)
server ="C:\\Ruby193\\bin\\rackup.bat", "--port", "9999")

Also, This codes works fine.

06 Mar 2014, 20:32
Ian Handley (1 post)
server ="C:\\Ruby193\\bin\\rackup.bat", "--port", "9999")


You must be logged in to comment