small medium large xlarge

14 Nov 2011, 03:20
Gary Pollice (8 posts)

One of the problems with any of the books that use Ruby-based tools is the installation. There are so many things that seem to differ on different platforms that it sometimes makes me want to just give up. Having the appendix with the installation information is a big help, but hopefully, you’ll create a blog, forum, or some other place where people can post their experiences and work arounds.

I followed the instructions in the book and it installed perfectly on my Mac OS X 10.6. Everything with the bundler worked just great. Then, I tried it on Ubuntu. There were enough things that went wrong that the best I could do was just comment out some of the items like aruba and sqlite3.

This isn’t your fault, you can only do so much. It’s a sad state of the art right now. Great tools are out there, but they’re often too much of a pain to set up that they don’t get used. Maybe the Pragmatic folks can put something together on how to administer the more popular FOSS software like the Ruby and Python ecosystems.

Anyway, great book. I’m starting to present cucumber in my software engineering courses.

04 Dec 2011, 14:58
Gary Pollice (8 posts)

Here’s an example of what I’m talking about. I need some help here. I figure’d I’d throw the post under this topic since it seems appropriate.

I’m at the point where I’m running the test (Section 9.4, p. 167 in the PDF version) and I get:

no such file to load -- service_manager (LoadError)
/opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
/opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
/opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
/Users/gpollice/MyCucumber/ATMBookExample/features/support/services.rb:5:in `<top (required)>'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/rb_support/rb_language.rb:129:in `load'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/rb_support/rb_language.rb:129:in `load_code_file'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/runtime/support_code.rb:171:in `load_file'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/runtime/support_code.rb:82:in `each'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/runtime.rb:174:in `load_step_definitions'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/runtime.rb:40:in `run!'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/cli/main.rb:43:in `execute!'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/cli/main.rb:20:in `execute'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/cucumber-1.1.3/bin/cucumber:14:in `<top (required)>'
/opt/local/bin/cucumber:19:in `load'
/opt/local/bin/cucumber:19:in `<main>'

Everything has worked up to this point. Now I’m at a loss. I’ve spent an hour or two trying to figure out what went wrong. Not much information out there, or maybe there’s too much. I don’t have the time to spend putting hours trying to figure out all of the dependency problems or version problems. This is what I was referring to about the state of using FOSS systems that belong to a rather intricate ecosystem.

I’m running Mac OS X, ruby 1.9.2. Any suggestions?

04 Dec 2011, 21:18
Matt Wynne (91 posts)

Hi Gary,

You need to run bundle install after you’ve updated the Gemfile at the beginning of that section. Sorry that wasn’t made clear in the text - I’ll correct it.

05 Dec 2011, 00:32
Gary Pollice (8 posts)


I did do that. Same result. I don’t think it’s necessarily a problem with Cucumber, but with the fragility of the whole Ruby setup across various platforms. Someone suggested putting require ‘rubygems’ before “the require.” I’m not sure where I’d do that.

05 Dec 2011, 11:01
Matt Wynne (91 posts)

Hi Gary,

Using @require ‘rubygems’@ should not be necessary on Ruby 1.9. It looks as though you’re using 1.9.1 rather than Ruby 1.9.3, which is the version we’ve tested the code in the book with. I appreciate that the installation instructions didn’t work for you on Ubuntu, so this might be awkward, but did you try using RVM? That should help you to manage things.

Could you also try to run the tests using the command @bundle exec cucumber@ instead of just @cucumber@ as it probably says to do in the text?

05 Dec 2011, 17:33
Gary Pollice (8 posts)


I get the same thing. I’m using Ruby 1.9.1/2 on Mac OS X 10.6. I haven’t tried this on Ubuntu yet. I’ve got a feeling that I have multiple Ruby installations on my system. I’m removing all of them (no small task) and will install 1.9.3 from the source. I’ll keep you posted.

05 Dec 2011, 18:01
Matt Wynne (91 posts)

I would use RVM. If you email me matt at mattwynne dot net I’ll send you the updated installation instructions appendix which I did today based on your feedback. It has better instructions for Ubuntu.

06 Dec 2011, 09:04
Aslak Hellesøy (17 posts)

Try which service_manager from the command line to find out where it lives.

Then try this from ruby, in services.rb before executing it: puts ENV['path]

That should give a clue…

06 Dec 2011, 20:01
Matt Wynne (91 posts)

Service Manager is a library, not a binary command, so I don’t think @which@ will help. You could try just using @gem list service@ to see whether it’s installed.

It sounds as though something’s gone quite screwy with your Ruby installations Gary. Sorry to hear about that, but rest assured that what you’re experiencing isn’t normal.

Propercroc avatar_pragsmall
13 Feb 2012, 13:23
Michael Probst (1 post)

Following, I was finally able to install ruby 1.9.3 on a Lion-running mac with XCode 4.2.1.

The following command saved me from the “C compiler cannot create executables” error message in the configure.log:

rvm install 1.9.3 --with-gcc=clang

14 Feb 2012, 18:33
Matt Wynne (91 posts)

Thanks for posting this Michael - Lion has made things even more interesting for us, and sadly too late to get into the print issue of the book. I also found this post helpful:

15 Feb 2012, 00:21
Chuck van der Linden (11 posts)

The way I escaped ‘interesting’ re Lion has been to do all this stuff on a windows system under Virtual Box. Installing everything was pretty darned easy, and I made use of PIK to allow myself to swap between ruby versions etc.

I can’t claim to have been a genius of foresight in knowing that LION was going to give folks fits however. My motives were different, since I will be doing a lot of browser based testing, most likely using watir-webdriver, maybe capybara (I remain skeptical), I wanted an environment where I could test the ‘big three’ browsers (IE, Chrome, FF). That rules out running under the native Mac OS because firstly it cannot run IE, and secondly even if it could, around 95% of the user’s on the web are running their browsers under windows, and I want to test those versions since that is what the vast majority of my users will be using. (the other testing is out of process REST API stuff, so that also works fine from a win system)

Knowing that getting all this running on LION is a PITA does however give me a second reason to espouse just doing all this under a VM

of course if I was doing a lot of in-process testing of Rails or LAMP based code etc, then using a windows platform VM might not be a viable solution

12 Sep 2012, 14:54
Dominik Jungowski (1 post)


I’m just working through the book and got stuck at the exact same moment. I’m using Windows, the error message I get is quite the same

cannot load such file -- pty (LoadError)
D:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
D:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
D:/Ruby/lib/ruby/gems/1.9.1/gems/background_process-1.3/lib/background_process/pty_background_process.rb:1:in `<top (required)>'
D:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
D:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
D:/Ruby/lib/ruby/gems/1.9.1/gems/background_process-1.3/lib/background_process.rb:3:in `<top (required)>'
D:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
D:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
D:/Ruby/lib/ruby/gems/1.9.1/gems/service_manager-0.6.2/lib/service_manager.rb:2:in `<top (required)>'
D:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
D:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
D:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
C:/Users/Dominik/Documents/NetBeansProjects/BDD-ATM/features/support/services.rb:2:in `<top (required)>'
D:/Ruby/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in `load'
D:/Ruby/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in `load_code_file'
D:/Ruby/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:171:in `load_file'
D:/Ruby/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
D:/Ruby/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in `each'
D:/Ruby/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
D:/Ruby/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:175:in `load_step_definitions'
D:/Ruby/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:40:in `run!'
D:/Ruby/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:43:in `execute!'
D:/Ruby/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:20:in `execute'
D:/Ruby/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/bin/cucumber:14:in `<top (required)>'
D:/Ruby/bin/cucumber:23:in `load'
D:/Ruby/bin/cucumber:23:in `<main>'

Ruby-Version is 1.9.3:

C:\Users\Dominik\Documents\NetBeansProjects\BDD-ATM>ruby --version
ruby 1.9.3p194 (2012-04-20) [i386-mingw32]

Neither require ‘rubygems’ nor running cucumber with “bundle exec cucumber” did help, the error is still the same.

Any help would be appreciated!

25 Nov 2012, 07:33
Justin Calcagni (17 posts)

I get the same error. Ubuntu 11.10

ruby version ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]

here is the error I get using just cucumber or bundle exec cucumber

bundle exec cucumber features/cash_withdrawl.feature no such file to load – service_manager (LoadError) /home/jcalcagni/demo_app/features/support/services.rb:1:in require' /home/jcalcagni/demo_app/features/support/services.rb:1:in <top (required)>’ /usr/lib/ruby/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/rb_support/rb_language.rb:129:in load' /usr/lib/ruby/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/rb_support/rb_language.rb:129:in load_code_file’ /usr/lib/ruby/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/runtime/support_code.rb:171:in load_file' /usr/lib/ruby/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/runtime/support_code.rb:83:in block in load_files!’ /usr/lib/ruby/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/runtime/support_code.rb:82:in each' /usr/lib/ruby/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/runtime/support_code.rb:82:in load_files!’ /usr/lib/ruby/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/runtime.rb:174:in load_step_definitions' /usr/lib/ruby/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/runtime.rb:40:in run!’ /usr/lib/ruby/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/cli/main.rb:43:in execute!' /usr/lib/ruby/gems/1.9.1/gems/cucumber-1.1.3/lib/cucumber/cli/main.rb:20:in execute’ /usr/lib/ruby/gems/1.9.1/gems/cucumber-1.1.3/bin/cucumber:14:in <top (required)>' /usr/bin/cucumber:23:in load’ /usr/bin/cucumber:23:in `'

04 Mar 2013, 01:41
Steven Jing (4 posts)

I got stuck on exactly same issue on windows. could anyone pls help me out?

04 Mar 2013, 07:19
Steven Jing (4 posts)

it seems windows doesn’t support pty

26 Mar 2013, 03:00
Shaun Dashjian (2 posts)

Solution: Use the latest version ‘0.6.4’ of service_manager rather than ‘0.6.2’ ` gem install ‘service_manager’ -v ‘0.6.4’ `

You must be logged in to comment