title: kernel_require.rb:55:in `require': cannot load such file error
body: <p>I'm using Ruby version 1.9.3 at the moment (although I get the same issue with Ruby 2.0.0). On Windows 7 64-bit.  I'm following 'The Cucumber Book' and got stuck at the chapter 7.2 - "Removing Duplication with Transforms". My folder structure is as follows:</p>
  
  <pre><code>\cash_withdrawal
  \cash_withdrawal\Gemfile
  \cash_withdrawal\Gemfile.lock
  \cash_withdrawal\features
  \cash_withdrawal\features\cash-withdrawal.feature
  \cash_withdrawal\features\step_definitions
  \cash_withdrawal\features\step_definitions\cash_withdrawal_steps.rb
  \cash_withdrawal\features\step_definitions\lib
  \cash_withdrawal\features\step_definitions\lib\nice_bank.rb
  \cash_withdrawal\features\support
  \cash_withdrawal\features\support\env.rb
  \cash_withdrawal\features\support\transforms.rb
  \cash_withdrawal\features\support\world_extensions.rb
  </code></pre>
  
  <p>In my <code>cash_withdrawal_steps.rb</code> file I have:</p>
  
  <pre><code>require 'CAPTURE_CASH_AMOUNT'
  
  Given /^I have deposited (#{CAPTURE_CASH_AMOUNT}) in my Account$/ do |amount|
    my_account.deposit(amount)
    my_account.balance.should eq(amount), 
      "Expected the balance to be #{amount} but it was #{my_account.balance}"
  end
  </code></pre>
  
  <p>When I run <code>cucumber</code> I get:</p>
  
  <blockquote>
    <p>C:\Users\Nikita.Harrison\AutomatedTesting\cash_withdrawal>cucumber
    cannot load such file -- CAPTURE_CASH_AMOUNT (LoadError)
    C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in
    <code>r equire'
    C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in
    </code>r equire'
    C:/Users/Nikita.Harrison/AutomatedTesting/cash_withdrawal/features/step_definiti
    ons/cash_withdrawal_steps.rb:1:in <code>&lt;top (required)&gt;'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.10/lib/cucumber/rb_support/rb_l
    anguage.rb:122:in</code>load'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.10/lib/cucumber/rb_support/rb_l
    anguage.rb:122:in <code>load_code_file'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.10/lib/cucumber/runtime/support
    _code.rb:180:in</code>load_file' C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.10/lib/cucumber/runtime/support
    _code.rb:83:in <code>block in load_files!' C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.10/lib/cucumber/runtime/support
    _code.rb:82:in</code>each' C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.10/lib/cucumber/runtime/support
    _code.rb:82:in <code>load_files!' C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.10/lib/cucumber/runtime.rb:184:
    in</code>load_step_definitions'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.10/lib/cucumber/runtime.rb:42:i
    n <code>run!'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.10/lib/cucumber/cli/main.rb:47:
    in</code>execute!'
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/cucumber-1.3.10/bin/cucumber:13:in
    <code>&lt;top (re quired)&gt;' C:/Ruby193/bin/cucumber:23:in</code>load'
    C:/Ruby193/bin/cucumber:23:in `'</p>
  </blockquote>
  
  <p>And if I run <code>irb</code> then run <code>require "CAPTURE_CASH_AMOUNT"</code> I get this error:</p>
  
  <blockquote>
    <p>irb(main):006:0> require "CAPTURE_CASH_AMOUNT" LoadError: cannot load
    such file -- CAPTURE_CASH_AMOUNT
            from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_requir
    e.rb:55:in <code>require'
            from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_requir
    e.rb:55:in</code>require'
            from (irb):6
            from C:/Ruby193/bin/irb:12:in `'</p>
  </blockquote>
  
  <p>I've tried many fixes including 'require_relative' and nothing seems to solve my problem.
  If I remove <code>require 'CAPTURE_CASH_AMOUNT'</code> from the <code>cash_withdrawal_steps.rb</code> file and run cucumber then my 'Step Definition' doesn't show as defined:</p>
  
  <pre><code>C:\Users\Nikita.Harrison\AutomatedTesting\cash_withdrawal&gt;cucumber
  Feature: Cash withdrawal
  
     @test   Scenario: Successful withdrawal from an account in credit #
   features\cash_with drawal.feature:4
       Given I have deposited $100 in my Account               # features\cash_with drawal.feature:5
       When I withdraw $20                                     # features/step_defi nitions/cash_withdrawal_steps.rb:7
       Then $20 should be dispensed                            # features/step_defi nitions/cash_withdrawal_steps.rb:11
       And the balance of my account should be $80             # features/step_defi nitions/cash_withdrawal_steps.rb:15
  
   1 scenario (1 undefined) 4 steps (3 skipped, 1 undefined) 0m0.006s
  
   You can implement step definitions for undefined steps with these
   snippets:
  
   Given(/^I have deposited \$(\d+) in my Account$/) do |arg1|   pending
   \# express the regexp above with the code you wish you had end
  </code></pre>
  
  <p>If I add <code>require File.join(File.dirname("C:/Users/Nikita.Harrison/AutomatedTesting/cash_withdrawal/features/support"), 'support', 'transforms')</code> to the <code>env.rb</code> file and run <code>cucumber</code> I get:</p>
  
  <pre><code> C:/Users/Nikita.Harrison/AutomatedTesting/cash_withdrawal/features/support/trans
   forms.rb:1: warning: already initialized constant CAPTURE_CASH_AMOUNT
   Feature: Cash withdrawal
  
     @test   Scenario: Successful withdrawal from an account in credit #
   features\cash_with drawal.feature:4
       Given I have deposited $100 in my Account               # features\cash_with drawal.feature:5
       When I withdraw $20                                     # features/step_defi nitions/cash_withdrawal_steps.rb:7
       Then $20 should be dispensed                            # features/step_defi nitions/cash_withdrawal_steps.rb:11
       And the balance of my account should be $80             # features/step_defi nitions/cash_withdrawal_steps.rb:15
  
   1 scenario (1 undefined) 4 steps (3 skipped, 1 undefined) 0m0.013s
  
   You can implement step definitions for undefined steps with these
   snippets:
  
   Given(/^I have deposited \$(\d+) in my Account$/) do |arg1|   pending
   \# express the regexp above with the code you wish you had end
  </code></pre>
  
  <p>I know I must be doing something wrong here but I just can't find out what and need help. 
  Gemfile contents:</p>
  
  <pre><code># This Gemfile lists all Gems used throughout the book - with versions.
  source :rubygems
  
  # Build stuff
  gem 'bundler', '1.5.3'
  #gem 'rake', '10.1.1'
  #gem 'watchr', '0.7'
  #gem 'bcat', '0.6.2'
  
  # General stuff
  #gem 'aruba', '0.4.11'
  gem 'cucumber', '1.3.10', :require =&gt; 'cucumber'
  gem 'rake', '10.1.1'
  gem 'rspec', '2.14.1', :require =&gt; 'cucumber'
  gem 'rspec-expectations', '2.14.5'
  gem 'watir-webdriver', '0.6.7'
  </code></pre>
  
  <p>I think I've included all the information that is needed.</p>